WriteTarget

Trait WriteTarget 

Source
pub trait WriteTarget: Clone + WriteTargetConditionalSendSync {
    // Required methods
    fn exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 Path,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn write<'life0, 'life1, 'async_trait, R>(
        &'life0 self,
        path: &'life1 Path,
        contents: R,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where R: AsyncRead + Unpin + WriteTargetConditionalSend + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn symlink<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        src: &'life1 Path,
        dst: &'life2 Path,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn spawn<'async_trait, F>(
        future: F,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where F: Future<Output = Result<()>> + WriteTargetConditionalSend + 'static + 'async_trait;
}
Expand description

An interface for accessing durable storage. This is used by transformers in this crate to render files from Noosphere content.

Required Methods§

Source

fn exists<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns true if a file exists at the provided path

Source

fn write<'life0, 'life1, 'async_trait, R>( &'life0 self, path: &'life1 Path, contents: R, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where R: AsyncRead + Unpin + WriteTargetConditionalSend + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Given a path and an AsyncRead, write the contents of the AsyncRead to the path

Create a symbolic link between the give source path and destination path

Source

fn spawn<'async_trait, F>( future: F, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where F: Future<Output = Result<()>> + WriteTargetConditionalSend + 'static + 'async_trait,

Spawn a Future in a platform-appropriate fashion and poll it to completion

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§