pub trait Accessor: Send + Sync {
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
args: &'life1 OpRead
) -> Pin<Box<dyn Future<Output = Result<BoxedAsyncRead>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
{ ... }
fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
r: BoxedAsyncRead,
args: &'life1 OpWrite
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
{ ... }
fn stat<'life0, 'life1, 'async_trait>(
&'life0 self,
args: &'life1 OpStat
) -> Pin<Box<dyn Future<Output = Result<Metadata>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
{ ... }
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
args: &'life1 OpDelete
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
{ ... }
}
Provided methods
Read data from the underlying storage into input writer.
Write data from input reader to the underlying storage.
Invoke the stat
operation on the specified path.
Delete
will invoke the delete
operation.
Behavior
Delete
is an idempotent operation, it’s safe to callDelete
on the same path multiple times.Delete
will returnOk(())
if the path is deleted successfully or not exist.
Implementations on Foreign Types
sourceimpl<T: Accessor> Accessor for Arc<T>
impl<T: Accessor> Accessor for Arc<T>
All functions in Accessor
only requires &self
, so it’s safe to implement
Accessor
for Arc<dyn Accessor>
.