WriteToAsync

Trait WriteToAsync 

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

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

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

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

Required Associated Types§

Source

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

The future type returned by the async write function.

Required Methods§

Source

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

Asynchronously writes the structure to the specified path.

Implementations on Foreign Types§

Source§

impl<'a, T, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for Option<T>
where T: WriteToAsync<'a, Vfs> + Send + 'static,

Source§

type Future = OptionWriteToAsyncFuture<'a, T, Vfs>

Source§

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

Source§

impl<'a, T, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for PhantomData<T>
where T: Send + Sync + 'static,

Source§

type Future = Ready<Result<(), Error<<<Vfs as VfsCore>::Path as PathType>::OwnedPath>>>

Source§

fn write_to_async( self, _path: <Vfs::Path as PathType>::OwnedPath, _vfs: Pin<&'a Vfs>, ) -> Self::Future

Source§

impl<'a, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for &'a str

Source§

type Future = <Vfs as WriteSupportingVfsAsync>::WriteFuture<'a>

Source§

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

Source§

impl<'a, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for &'a [u8]

Source§

type Future = <Vfs as WriteSupportingVfsAsync>::WriteFuture<'a>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<'a, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for Vec<u8>

Source§

type Future = <FileBytesRefWr<'a, 'a, Vfs> as WriteToAsync<'a, Vfs>>::Future

Source§

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

Source§

impl<'a, Vfs: WriteSupportingVfsAsync + ?Sized + 'a> WriteToAsync<'a, Vfs> for ()

Source§

type Future = Ready<Result<(), Error<<<Vfs as VfsCore>::Path as PathType>::OwnedPath>>>

Source§

fn write_to_async( self, _path: <<Vfs as VfsCore>::Path as PathType>::OwnedPath, _vfs: Pin<&'a Vfs>, ) -> Self::Future

Implementors§

Source§

impl<'a, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for FileBytesRefWr<'a, 'a, Vfs>

Source§

type Future = Pin<Box<dyn Future<Output = Result<(), Error<<<Vfs as VfsCore>::Path as PathType>::OwnedPath>>> + Send + 'a>>

Source§

impl<'a, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for FileStrWr<'a, 'a, Vfs>

Source§

type Future = <FileBytesRefWr<'a, 'a, Vfs> as WriteToAsync<'a, Vfs>>::Future

Source§

impl<'a, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for FileString

Source§

type Future = Pin<Box<dyn Future<Output = Result<(), Error<<<Vfs as VfsCore>::Path as PathType>::OwnedPath>>> + Send + 'a>>