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> WriteToAsync<'a, Vfs> for (&'a DynamicImage, ImageFormat)

Available on crate feature image only.
Source§

type Future = <Vfs as WriteImageToAsyncRef<'a>>::WriteImageRefFuture

Source§

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

Source§

impl<'a, Vfs> WriteToAsync<'a, Vfs> for (DynamicImage, ImageFormat)

Available on crate feature image only.
Source§

type Future = <Vfs as WriteImageToAsync<'a>>::WriteImageFuture

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, T, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for FmtWrapperRefWr<'a, 'vfs, T, Vfs>
where T: Display + Send + 'a, 'vfs: 'a,

Source§

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

Source§

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

Source§

impl<'a, T, F, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for ForceCreateDirChildren<T, F, Vfs::Path>
where T: WriteToAsync<'a, Vfs> + Send + Sync + 'static, F: Filter<Vfs::Path> + Send + Sync + 'static, T::Future: Future<Output = VfsResult<(), Vfs>> + Unpin + 'a,

Source§

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

Source§

impl<'a, T, P, H, Vfs: WriteSupportingVfsAsync<Path = P> + 'a> WriteToAsync<'a, Vfs> for VersionedHash<T, P, H>
where T: WriteToAsync<'a, Vfs> + Hash + 'a, P: PathType + ?Sized + PartialEq + 'a, H: Hasher + Default + 'a,

Source§

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

Source§

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

Source§

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

Source§

impl<'a, T, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for CleanDirRefWr<'a, 'a, T, Vfs>
where T: WriteToAsyncRef<'a, Vfs> + Send + Sync + 'static, 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 = CleanDirRefWrWriteFuture<'a, 'a, T, Vfs>

Source§

impl<'a, T, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for Json<T>
where T: Serialize + for<'d> Deserialize<'d> + Send + Sync + 'static,

Available on crate feature json only.
Source§

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

Source§

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

Available on crate feature json only.
Source§

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

Source§

impl<'a, T, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for JsonPretty<T>
where T: Serialize + for<'d> Deserialize<'d> + Send + Sync + 'static,

Available on crate feature json only.
Source§

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

Source§

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

Available on crate feature json only.
Source§

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

Source§

impl<'a, T, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for Ron<T>
where T: Serialize + for<'d> Deserialize<'d> + Send + Sync + 'static,

Available on crate feature ron only.
Source§

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

Source§

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

Available on crate feature ron only.
Source§

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

Source§

impl<'a, T, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for RonPretty<T>
where T: Serialize + for<'d> Deserialize<'d> + Send + Sync + 'static,

Available on crate feature ron only.
Source§

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

Source§

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

Available on crate feature ron only.
Source§

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

Source§

impl<'a, T, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for Toml<T>
where T: Serialize + for<'d> Deserialize<'d> + Send + Sync + 'static,

Available on crate feature toml only.
Source§

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

Source§

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

Available on crate feature toml only.
Source§

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

Source§

impl<'a, T, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for Yaml<T>
where T: Serialize + for<'d> Deserialize<'d> + Send + Sync + 'static,

Available on crate feature yaml only.
Source§

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

Source§

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

Available on crate feature yaml only.
Source§

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

Source§

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

Source§

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

Source§

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

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>>

Source§

impl<'a, const CHECK_ON_READ: bool, T, Vfs: WriteSupportingVfsAsync + 'static> WriteToAsync<'a, Vfs> for DeferredReadOrOwn<'a, T, Vfs, CHECK_ON_READ>
where T: for<'b> ReadFromAsync<'b, Vfs> + for<'b> WriteToAsync<'b, Vfs> + Send + 'static, for<'b> <T as ReadFromAsync<'b, Vfs>>::Future: Future<Output = VfsResult<T, Vfs>> + Unpin + 'b, for<'b> <T as WriteToAsync<'b, Vfs>>::Future: Future<Output = VfsResult<(), Vfs>> + Unpin + 'b,

Source§

type Future = DeferredReadOrOwnWriteFuture<'a, T, Vfs, CHECK_ON_READ>

Source§

impl<'f, const CHECK_ON_READ: bool, T, P: PathType + ?Sized + 'f, SelfVfs: VfsAsync<Path = P> + 'f, TargetVfs: WriteSupportingVfsAsync<Path = P> + 'f> WriteToAsync<'f, TargetVfs> for DeferredRead<'f, T, SelfVfs, CHECK_ON_READ>
where T: for<'a> ReadFromAsync<'a, SelfVfs> + for<'a> WriteToAsync<'a, TargetVfs> + Send + 'static, 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 = DeferredReadWriteFuture<'f, T, P, SelfVfs, TargetVfs>

Source§

impl<'vfs, T, Vfs> WriteToAsync<'vfs, Vfs> for AtomicDir<T>
where T: WriteToAsync<'vfs, Vfs> + Send + 'static, Vfs: VfsSupportsTemporaryDirectoriesAsync<'vfs> + VfsAsync + Send + WriteSupportingVfsAsync + 'vfs,

Source§

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

Source§

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

Available on crate feature image only.
Source§

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

Source§

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

Source§

impl<'vfs, Vfs: WriteSupportingVfsAsync + 'vfs, T: WriteToAsync<'vfs, Vfs> + Send + 'vfs, F: FileFilter<Vfs::Path> + FolderRecurseFilter<Vfs::Path> + FolderFilter<Vfs::Path> + Send + 'vfs> WriteToAsync<'vfs, Vfs> for DirDescendants<T, F, Vfs::Path>

Source§

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