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§

Source§

impl<'a, T, H, Vfs: WriteSupportingVfsAsync + 'a> WriteToAsyncRef<'a, Vfs> for VersionedHash<T, Vfs::Path, H>
where T: WriteToAsyncRef<'a, Vfs> + Hash + 'a, H: Hasher + Default + 'a,

Source§

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

Source§

impl<'a, T, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsyncRef<'a, Vfs> for CleanDir<T>
where T: WriteToAsyncRef<'a, Vfs> + Send + Sync + 'static, for<'f> <T as WriteToAsyncRef<'a, Vfs>>::Future<'f>: Future<Output = VfsResult<(), Vfs>> + Unpin + 'f, for<'f> <Vfs as VfsAsync>::ExistsFuture<'f>: Future<Output = VfsResult<bool, Vfs>> + Unpin + 'f, for<'f> <Vfs as WriteSupportingVfsAsync>::RemoveDirAllFuture<'f>: Future<Output = VfsResult<(), Vfs>> + Unpin + 'f,

Source§

type Future<'b> = CleanDirWriteRefFuture<'a, 'b, T, Vfs> where Self: 'b, Vfs: 'b, 'a: 'b

Source§

impl<'a, T, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsyncRef<'a, Vfs> for FmtWrapper<T>
where T: Display + Send + Sync + 'a,

Source§

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

Source§

impl<'f, const CHECK_ON_READ: bool, T, P: PathType + ?Sized + 'f, SelfVfs: VfsAsync<Path = P> + 'f, TargetVfs: WriteSupportingVfsAsync<Path = P> + 'f> WriteToAsyncRef<'f, TargetVfs> for DeferredRead<'f, T, SelfVfs, CHECK_ON_READ>
where for<'a> T: ReadFromAsync<'a, SelfVfs> + WriteToAsync<'a, TargetVfs> + Send + 'a, for<'a> <T as ReadFromAsync<'a, SelfVfs>>::Future: Future<Output = VfsResult<T, SelfVfs>> + Unpin + 'a, for<'a> <T as WriteToAsync<'a, TargetVfs>>::Future: Future<Output = VfsResult<(), TargetVfs>> + Unpin + 'a,

Source§

type Future<'a> = DeferredReadWriteFuture<'a, T, P, SelfVfs, TargetVfs> where Self: 'a, 'f: 'a

Source§

impl<'r, T, F, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsyncRef<'r, Vfs> for DirChildren<T, F, Vfs::Path>
where T: WriteToAsyncRef<'r, Vfs> + Send + Sync + 'static, F: Filter<Vfs::Path> + Send + 'static, for<'f> <T as WriteToAsyncRef<'r, Vfs>>::Future<'f>: Future<Output = VfsResult<(), Vfs>> + Unpin + 'f,

Source§

type Future<'a> = DirChildrenWriteAsyncRefFuture<'r, 'a, T, Vfs> where T: 'a, Vfs: 'a, Self: 'a, 'r: 'a

Source§

impl<'r, T, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsyncRef<'r, Vfs> for Versioned<T, Vfs::Path>
where T: WriteToAsyncRef<'r, Vfs> + Send + Sync + 'static, for<'f> <T as WriteToAsyncRef<'r, Vfs>>::Future<'f>: Future<Output = VfsResult<(), Vfs>> + Unpin + 'f, Vfs::Path: PartialEq,

Source§

type Future<'a> = VersionedWriteRefFuture<'r, 'a, T, Vfs> where Self: 'a, Vfs: 'a, 'r: 'a

Source§

impl<'vfs, T, Vfs> WriteToAsyncRef<'vfs, Vfs> for AtomicDir<T>
where T: WriteToAsyncRef<'vfs, Vfs> + Sync + 'static, for<'r> <T as WriteToAsyncRef<'vfs, Vfs>>::Future<'r>: Future<Output = VfsResult<(), Vfs>> + Unpin + Send + 'r, for<'r> Vfs: VfsSupportsTemporaryDirectoriesAsync<'r> + VfsAsync + Send + 'static + WriteSupportingVfsAsync + 'vfs,

Source§

type Future<'r> = AtomicDirWriteToAsyncRefFuture<'r, 'vfs, T, Vfs> where Self: 'r, 'vfs: 'r

Source§

impl<'vfs, Vfs, P: PathType + ?Sized + 'vfs, T: ImgFormat> WriteToAsyncRef<'vfs, Vfs> for T
where Vfs: 'vfs + VfsAsyncWithSeekWrite<Path = P>, Vfs::WFile: AsyncSeek, for<'a> (&'a DynamicImage, ImageFormat): WriteToAsync<'a, Vfs>,

Available on crate feature image only.
Source§

type Future<'a> = <(&'a DynamicImage, ImageFormat) as WriteToAsync<'a, Vfs>>::Future where Self: 'a, Vfs: 'a, 'vfs: 'a

Source§

impl<'vfs, Vfs, T, P> WriteToAsyncRef<'vfs, Vfs> for TryParse<T, P>
where P: PathType + ?Sized + 'vfs, Vfs: WriteSupportingVfsAsync<Path = P> + 'static, T: WriteToAsyncRef<'vfs, Vfs> + Send + 'vfs, for<'a> <T as WriteToAsyncRef<'vfs, Vfs>>::Future<'a>: Future<Output = VfsResult<(), Vfs>> + Send + Sync + Unpin + 'a,

Source§

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

Source§

impl<'vfs, Vfs: WriteSupportingVfsAsync<Path = P> + 'static, P: ?Sized + PathType, T: WriteToAsyncRef<'vfs, Vfs> + Sync + 'static, F: FileFilter<P> + FolderRecurseFilter<P> + FolderFilter<P> + Sync + 'vfs> WriteToAsyncRef<'vfs, Vfs> for DirDescendants<T, F, P>
where for<'r> T::Future<'r>: Future<Output = VfsResult<(), Vfs>> + Unpin + 'r,

Source§

type Future<'r> = DirDescendantsWriteRefFuture<'r, 'vfs, Vfs, T> where Self: 'r, Vfs: 'r, T: 'r, 'vfs: 'r