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§
Sourcefn 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 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
Sourcefn 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 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,
Sourcefn 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 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,
Create a symbolic link between the give source path and destination path
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.