pub trait TrashBackend: Send + Sync {
// Required methods
fn trash<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<(), TrashError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
filter: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrashEntry>, TrashError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn find_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrashEntry>, TrashError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn restore<'life0, 'async_trait>(
&'life0 self,
entries: Vec<TrashEntry>,
) -> Pin<Box<dyn Future<Output = Result<(), TrashError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn purge_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize, TrashError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Backend trait for trash operations.
Required Methods§
Sourcefn trash<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<(), TrashError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn trash<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<(), TrashError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Move a file or directory to trash.
Sourcefn list<'life0, 'life1, 'async_trait>(
&'life0 self,
filter: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrashEntry>, TrashError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
filter: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrashEntry>, TrashError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List trashed items, optionally filtered by name substring.
Sourcefn find_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrashEntry>, TrashError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<TrashEntry>, TrashError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find entries matching a name (exact first, then substring).
Returns matched entries or an error describing the ambiguity.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".