use std::{collections::HashMap, path::PathBuf}; use crate::types::*; 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: PathBuf, delete: Option, domains: Option, ) -> Result; /// import file into hydrus by sending the file async fn add_file_via_file(&self, file: PathBuf) -> Result; }