pub trait Accessor: Send + Sync + Debug {
    fn read<'life0, 'life1, 'async_trait>(
        &'life0 self,
        args: &'life1 OpRead
    ) -> Pin<Box<dyn Future<Output = Result<BytesReader>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
fn write<'life0, 'life1, 'async_trait>(
        &'life0 self,
        args: &'life1 OpWrite
    ) -> Pin<Box<dyn Future<Output = Result<BytesWriter>> + 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
, { ... }
fn list<'life0, 'life1, 'async_trait>(
        &'life0 self,
        args: &'life1 OpList
    ) -> Pin<Box<dyn Future<Output = Result<ObjectStreamer>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } }
Expand description

Underlying trait of all backends for implementors.

Note

Only service implementor should care about this trait, users need to use Operator instead.

Provided methods

Invoke the read operation on the specified path, returns a BytesReader if operate successful.

Invoke the write operation on the specified path, returns a BytesWriter if operate successful.

Invoke the stat operation on the specified path.

Behavior
  • Stat empty path means stat backend’s root path.
  • Stat a path endswith “/” means stating a dir.
    • On fs, an error could return if not a dir.
    • On s3 alike backends, a dir object will return no matter it exist or not.

Delete will invoke the delete operation.

Behavior
  • Delete is an idempotent operation, it’s safe to call Delete on the same path multiple times.
  • Delete will return Ok(()) if the path is deleted successfully or not exist.

Implementations on Foreign Types

All functions in Accessor only requires &self, so it’s safe to implement Accessor for Arc<dyn Accessor>.

Implementors