start implementing getting meta for structure

This commit is contained in:
OMGeeky
2024-04-14 14:52:47 +02:00
parent 2a66a6572a
commit 2f72a8a7c7
8 changed files with 207 additions and 42 deletions

View File

@@ -10,6 +10,7 @@ use std::path::PathBuf;
#[tarpc::service]
pub trait GDriverService {
async fn set_offline_mode(offline_mode: bool) -> StdResult<(), GDriverServiceError>;
async fn get_file_by_name(
name: OsString,
parent: DriveId,
@@ -52,6 +53,7 @@ lazy_static! {
pub mod errors {
use super::*;
use crate::path_resolve_error::PathResolveError;
#[derive(Debug, Serialize, Deserialize, thiserror::Error)]
pub enum GDriverServiceError {
#[error("Error getting the settings: {0}")]
@@ -102,6 +104,8 @@ pub mod errors {
NotFound,
#[error("Could not update drive info")]
Update(String),
#[error("Could not resolve path")]
PathResolve(#[from] PathResolveError),
}
#[derive(Debug, Serialize, Deserialize, thiserror::Error)]

View File

@@ -5,5 +5,6 @@ pub mod prelude;
pub mod config;
pub mod drive_structure;
pub mod ipc;
pub mod path_resolve_error;
pub mod project_dirs;
pub mod tracing_setup;

View File

@@ -0,0 +1,9 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize, thiserror::Error)]
pub enum PathResolveError {
#[error("The path provided was invalid")]
InvalidPath,
#[error("Some other error occurred")]
Other(String),
}