WriteSupportingVfsExt

Trait WriteSupportingVfsExt 

Source
pub trait WriteSupportingVfsExt<'vfs>: WriteSupportingVfs<'vfs> {
    // Provided methods
    fn write_typed_pinned<T: WriteTo<'vfs, Self>>(
        self: Pin<&'vfs Self>,
        path: impl AsRef<Self::Path>,
        value: &T,
    ) -> VfsResult<(), Self> { ... }
    fn write_typed<T: WriteTo<'vfs, Self>>(
        &'vfs self,
        path: impl AsRef<Self::Path>,
        value: &T,
    ) -> VfsResult<(), Self>
       where Self: Unpin { ... }
}
Expand description

Extension trait for WriteSupportingVfs that provides additional convenience methods.

Provided Methods§

Source

fn write_typed_pinned<T: WriteTo<'vfs, Self>>( self: Pin<&'vfs Self>, path: impl AsRef<Self::Path>, value: &T, ) -> VfsResult<(), Self>

Writes a file / directory at the specified path, using the specified data type’s WriteTo implementation.

This method takes self as a pinned reference, to ensure that the Vfs implementation is not moved while the write operation is in progress.

Source

fn write_typed<T: WriteTo<'vfs, Self>>( &'vfs self, path: impl AsRef<Self::Path>, value: &T, ) -> VfsResult<(), Self>
where Self: Unpin,

Writes a file / directory at the specified path, using the specified data type’s WriteTo implementation.

This method takes self as a regular reference, and pins it internally.

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.

Implementors§

Source§

impl<'vfs, Vfs: WriteSupportingVfs<'vfs> + ?Sized> WriteSupportingVfsExt<'vfs> for Vfs