Backend

Trait Backend 

Source
pub trait Backend:
    Clone
    + Send
    + Sync {
    // Required methods
    fn metadata<'life0, 'async_trait>(
        &'life0 self,
        path: impl 'async_trait + PathRef,
    ) -> Pin<Box<dyn Future<Output = Result<Metadata>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list<'life0, 'async_trait>(
        &'life0 self,
        path: impl 'async_trait + PathRef,
    ) -> Pin<Box<dyn Future<Output = Result<VecDeque<Metadata>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn open<'life0, 'async_trait>(
        &'life0 self,
        path: impl 'async_trait + PathRef,
        read: bool,
        write: bool,
        append: bool,
        create: bool,
        truncate: bool,
        create_new: bool,
    ) -> Pin<Box<dyn Future<Output = Result<OpenFile>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_metadata<'life0, 'async_trait>(
        &'life0 self,
        path: impl 'async_trait + PathRef,
        uid_and_gid: Option<(u32, u32)>,
        permissions: Option<u32>,
        atime_and_mtime: Option<(u32, u32)>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete_file<'life0, 'async_trait>(
        &'life0 self,
        path: impl 'async_trait + PathRef,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn mkdir<'life0, 'async_trait>(
        &'life0 self,
        path: impl 'async_trait + PathRef,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn rmdir<'life0, 'async_trait>(
        &'life0 self,
        path: impl 'async_trait + PathRef,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn rename<'life0, 'async_trait>(
        &'life0 self,
        from: impl 'async_trait + PathRef,
        to: impl 'async_trait + PathRef,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn readlink<'life0, 'async_trait>(
        &'life0 self,
        path: impl 'async_trait + PathRef,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Utf8PathBuf>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn mklink<'life0, 'async_trait>(
        &'life0 self,
        link_path: impl 'async_trait + PathRef,
        target_path: impl 'async_trait + PathRef,
        link_type: LinkType,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn normalize_path<'a, 'path>(
        &'a self,
        path: &'path Utf8Path,
    ) -> Result<Cow<'path, Utf8Path>> { ... }
}

Required Methods§

Source

fn metadata<'life0, 'async_trait>( &'life0 self, path: impl 'async_trait + PathRef, ) -> Pin<Box<dyn Future<Output = Result<Metadata>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn list<'life0, 'async_trait>( &'life0 self, path: impl 'async_trait + PathRef, ) -> Pin<Box<dyn Future<Output = Result<VecDeque<Metadata>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn open<'life0, 'async_trait>( &'life0 self, path: impl 'async_trait + PathRef, read: bool, write: bool, append: bool, create: bool, truncate: bool, create_new: bool, ) -> Pin<Box<dyn Future<Output = Result<OpenFile>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn set_metadata<'life0, 'async_trait>( &'life0 self, path: impl 'async_trait + PathRef, uid_and_gid: Option<(u32, u32)>, permissions: Option<u32>, atime_and_mtime: Option<(u32, u32)>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn delete_file<'life0, 'async_trait>( &'life0 self, path: impl 'async_trait + PathRef, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn mkdir<'life0, 'async_trait>( &'life0 self, path: impl 'async_trait + PathRef, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn rmdir<'life0, 'async_trait>( &'life0 self, path: impl 'async_trait + PathRef, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn rename<'life0, 'async_trait>( &'life0 self, from: impl 'async_trait + PathRef, to: impl 'async_trait + PathRef, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn normalize_path<'a, 'path>( &'a self, path: &'path Utf8Path, ) -> Result<Cow<'path, Utf8Path>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§