WriteToAsyncRef

Trait WriteToAsyncRef 

Source
pub trait WriteToAsyncRef<'r, Vfs: WriteSupportingVfsAsync + ?Sized + 'r> {
    type Future<'a>: Future<Output = VfsResult<(), Vfs>> + Send + Unpin + 'a
       where Self: 'a,
             Vfs: 'a,
             'r: 'a;

    // Required method
    fn write_to_async_ref<'a>(
        &'a self,
        path: <<Vfs as VfsCore>::Path as PathType>::OwnedPath,
        vfs: Pin<&'a Vfs>,
    ) -> Self::Future<'a>
       where 'r: 'a;
}
Available on crate feature async only.
Expand description

Trait for types / structures that can be written to disk asynchronously.

The difference between this and WriteToAsync is that this trait takes in a reference instead of owned data.

This is an async equivalent of WriteTo.

Required Associated Types§

Source

type Future<'a>: Future<Output = VfsResult<(), Vfs>> + Send + Unpin + 'a where Self: 'a, Vfs: 'a, 'r: 'a

The future type returned by the async write function.

Required Methods§

Source

fn write_to_async_ref<'a>( &'a self, path: <<Vfs as VfsCore>::Path as PathType>::OwnedPath, vfs: Pin<&'a Vfs>, ) -> Self::Future<'a>
where 'r: 'a,

Asynchronously writes the structure to the specified 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.

Implementations on Foreign Types§

Source§

impl<'a, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsyncRef<'a, Vfs> for String

Source§

type Future<'b> = <FileString as WriteToAsync<'b, Vfs>>::Future where Self: 'b, Vfs: 'b, 'a: 'b

Source§

fn write_to_async_ref<'b>( &'b self, path: <Vfs::Path as PathType>::OwnedPath, vfs: Pin<&'b Vfs>, ) -> <Self as WriteToAsync<'b, Vfs>>::Future
where 'a: 'b,

Implementors§