pub struct StorageManager {
pub safe_dir: PathBuf,
pub metadata_file: PathBuf,
pub safe_files: Vec<SafeFile>,
}
Expand description
StorageManager handles all operations related to safe storage
Fields§
§safe_dir: PathBuf
§metadata_file: PathBuf
§safe_files: Vec<SafeFile>
Implementations§
Source§impl StorageManager
impl StorageManager
pub fn new() -> Result<Self, String>
pub fn save_metadata(&self) -> Result<(), String>
pub fn add_file(&mut self, safe_file: SafeFile)
Sourcepub fn remove_file(&mut self, moved_path: &Path)
pub fn remove_file(&mut self, moved_path: &Path)
Remove a file from the safe storage metadata
pub fn find_safe_file(&self, file_name: &str) -> Option<&SafeFile>
pub fn cleanup(&mut self) -> Result<(), String>
pub fn get_safe_files(&self) -> Vec<&SafeFile>
pub fn list_files(&self)
pub fn cleanup_all_files(&mut self) -> Result<(), String>
Auto Trait Implementations§
impl Freeze for StorageManager
impl RefUnwindSafe for StorageManager
impl Send for StorageManager
impl Sync for StorageManager
impl Unpin for StorageManager
impl UnwindSafe for StorageManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more