pub struct FilesystemQuarantine { /* private fields */ }Expand description
Filesystem-based quarantine storage.
Stores quarantined files in a designated directory with their metadata. Files are stored with obfuscated names to prevent accidental execution.
§Directory Structure
quarantine/
├── data/
│ └── {id}.qdata # Quarantined file (obfuscated)
└── meta/
└── {id}.json # MetadataImplementations§
Source§impl FilesystemQuarantine
impl FilesystemQuarantine
Trait Implementations§
Source§impl Debug for FilesystemQuarantine
impl Debug for FilesystemQuarantine
Source§impl QuarantineStore for FilesystemQuarantine
impl QuarantineStore for FilesystemQuarantine
Source§fn store<'life0, 'life1, 'async_trait>(
&'life0 self,
input: &'life1 FileInput,
record: QuarantineRecord,
) -> Pin<Box<dyn Future<Output = Result<QuarantineId, QuarantineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store<'life0, 'life1, 'async_trait>(
&'life0 self,
input: &'life1 FileInput,
record: QuarantineRecord,
) -> Pin<Box<dyn Future<Output = Result<QuarantineId, QuarantineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stores a file in quarantine. Read more
Source§fn retrieve<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 QuarantineId,
) -> Pin<Box<dyn Future<Output = Result<(Vec<u8>, QuarantineRecord), QuarantineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn retrieve<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 QuarantineId,
) -> Pin<Box<dyn Future<Output = Result<(Vec<u8>, QuarantineRecord), QuarantineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves a file from quarantine. Read more
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 QuarantineId,
) -> Pin<Box<dyn Future<Output = Result<(), QuarantineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 QuarantineId,
) -> Pin<Box<dyn Future<Output = Result<(), QuarantineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes a file from quarantine. Read more
Source§fn list<'life0, 'async_trait>(
&'life0 self,
filter: QuarantineFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<QuarantineRecord>, QuarantineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list<'life0, 'async_trait>(
&'life0 self,
filter: QuarantineFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<QuarantineRecord>, QuarantineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lists quarantine records matching the filter. Read more
Source§fn count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize, QuarantineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize, QuarantineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the number of quarantined files.
Source§fn contains_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, QuarantineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn contains_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, QuarantineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Checks if a file with the given hash is already quarantined.
Source§fn get_record<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 QuarantineId,
) -> Pin<Box<dyn Future<Output = Result<QuarantineRecord, QuarantineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_record<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 QuarantineId,
) -> Pin<Box<dyn Future<Output = Result<QuarantineRecord, QuarantineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gets a record by ID without retrieving the file contents.
Source§fn cleanup_expired<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize, QuarantineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cleanup_expired<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize, QuarantineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Deletes all expired quarantine records.
Auto Trait Implementations§
impl !Freeze for FilesystemQuarantine
impl RefUnwindSafe for FilesystemQuarantine
impl Send for FilesystemQuarantine
impl Sync for FilesystemQuarantine
impl Unpin for FilesystemQuarantine
impl UnsafeUnpin for FilesystemQuarantine
impl UnwindSafe for FilesystemQuarantine
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