From bdc2e645c2d174881f7278139de95b141328431e Mon Sep 17 00:00:00 2001 From: jakka Date: Thu, 18 Sep 2025 10:55:49 +0300 Subject: added documentation --- src/traits.rs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/traits.rs') diff --git a/src/traits.rs b/src/traits.rs index d8f68f2..d3390a5 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -5,33 +5,37 @@ use async_trait::async_trait; type Result = std::result::Result; +/// trait for accessing and managing keys and services #[async_trait] pub trait AccessManagement { + /// request new api key async fn request_new_permissions( &self, name: &str, permissions: &[HydrusPermissions], ) -> Result; - + /// request new session key async fn get_session_key(&self) -> Result; - + /// verify session or api key async fn verify_access_key(&self, key: &str) -> Result; - + /// get service info by providing service name async fn get_service_name(&self, name: &str) -> Result; - + /// get service info by providing service key async fn get_service_key(&self, key: &str) -> Result; - + /// get all service info async fn get_services(&self) -> Result>; } +/// trait for importing and deleting files #[async_trait] pub trait ImportingAndDeletingFiles { + /// import file into hydrus by providing a local (hydrus-local) file path async fn add_file_via_path( &self, - path: &str, + path: PathBuf, delete: Option, domains: Option, - ) -> Result; - - async fn add_file_via_file(&self, file: PathBuf) -> Result; + ) -> Result; + /// import file into hydrus by sending the file + async fn add_file_via_file(&self, file: PathBuf) -> Result; } -- cgit v1.3.1