mirror of
https://github.com/OMGeeky/gdriver2.git
synced 2026-01-20 02:21:01 +01:00
start implementing getting meta for structure
This commit is contained in:
@@ -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)]
|
||||
|
||||
@@ -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;
|
||||
|
||||
9
gdriver-common/src/path_resolve_error.rs
Normal file
9
gdriver-common/src/path_resolve_error.rs
Normal 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),
|
||||
}
|
||||
Reference in New Issue
Block a user