WriteTo

Trait WriteTo 

Source
pub trait WriteTo<'vfs, Vfs: WriteSupportingVfs<'vfs> + ?Sized> {
    // Required method
    fn write_to(
        &self,
        path: &Vfs::Path,
        vfs: Pin<&'vfs Vfs>,
    ) -> VfsResult<(), Vfs>;
}
Expand description

Trait for types / structures that can be written to disk. All types in the library that write to files first check that the parent directories exist, so implementations of this that create the whole directory are not necessary (unless used empty children directories, in which case no directories will really be created).

Required Methods§

Source

fn write_to(&self, path: &Vfs::Path, vfs: Pin<&'vfs Vfs>) -> VfsResult<(), Vfs>

Writes the structure to the specified path.

Implementations on Foreign Types§

Source§

impl<'a, T, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for PhantomData<T>

Source§

fn write_to(&self, _path: &Vfs::Path, _vfs: Pin<&'a Vfs>) -> VfsResult<(), Vfs>

Source§

impl<'a, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for &str

Source§

fn write_to(&self, path: &Vfs::Path, vfs: Pin<&'a Vfs>) -> VfsResult<(), Vfs>

Source§

impl<'a, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for &[u8]

Source§

fn write_to(&self, path: &Vfs::Path, vfs: Pin<&'a Vfs>) -> VfsResult<(), Vfs>

Source§

impl<'a, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for str

Source§

fn write_to(&self, path: &Vfs::Path, vfs: Pin<&'a Vfs>) -> VfsResult<(), Vfs>

Source§

impl<'a, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for String

Source§

fn write_to(&self, path: &Vfs::Path, vfs: Pin<&'a Vfs>) -> VfsResult<(), Vfs>

Source§

impl<'a, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for Vec<u8>

Source§

fn write_to(&self, path: &Vfs::Path, vfs: Pin<&'a Vfs>) -> VfsResult<(), Vfs>

Source§

impl<'a, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for [u8]

Source§

fn write_to(&self, path: &Vfs::Path, vfs: Pin<&'a Vfs>) -> VfsResult<(), Vfs>

Source§

impl<'vfs, T, P: PathType + ?Sized + 'vfs, Vfs: WriteSupportingVfs<'vfs, Path = P>> WriteTo<'vfs, Vfs> for Option<T>
where T: WriteTo<'vfs, Vfs>,

Source§

fn write_to(&self, path: &P, vfs: Pin<&'vfs Vfs>) -> VfsResult<(), Vfs>

Source§

impl<'vfs, Vfs: WriteSupportingVfs<'vfs>> WriteTo<'vfs, Vfs> for ()

Source§

fn write_to( &self, _path: &Vfs::Path, _vfs: Pin<&'vfs Vfs>, ) -> VfsResult<(), Vfs>

Implementors§

Source§

impl<'a, 'vfs, Vfs: WriteSupportingVfs<'vfs>> WriteTo<'vfs, Vfs> for FileBytesRefWr<'a, 'vfs, Vfs>
where 'vfs: 'a,

Source§

impl<'a, 'vfs, Vfs: WriteSupportingVfs<'vfs>> WriteTo<'vfs, Vfs> for FileStrWr<'a, 'vfs, Vfs>
where 'vfs: 'a,

Source§

impl<'a, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for FileBytes

Source§

impl<'a, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for FileString