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: VfsWithSeekWrite<'vfs>> WriteTo<'vfs, Vfs> for (&DynamicImage, ImageFormat)
where Vfs::WFile: Seek,

Available on crate feature image only.
Source§

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

Source§

impl<'vfs, Vfs: VfsWithSeekWrite<'vfs>> WriteTo<'vfs, Vfs> for (DynamicImage, ImageFormat)
where Vfs::WFile: Seek,

Available on crate feature image only.
Source§

fn write_to(&self, path: &Vfs::Path, 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, 't, const CHECK_ON_READ: bool, T, P: PathType + ?Sized + 'a, SelfVfs: Vfs<'a, Path = P>, TargetVfs: WriteSupportingVfs<'t, Path = P>> WriteTo<'t, TargetVfs> for DeferredReadOrOwn<'a, T, SelfVfs, CHECK_ON_READ>
where T: ReadFrom<'a, SelfVfs> + WriteTo<'t, TargetVfs>,

Source§

impl<'a, 't, const CHECK_ON_READ: bool, T, P: PathType + ?Sized + 'a, SelfVfs: Vfs<'a, Path = P>, TargetVfs: WriteSupportingVfs<'t, Path = P>> WriteTo<'t, TargetVfs> for DeferredRead<'a, T, SelfVfs, CHECK_ON_READ>
where T: ReadFrom<'a, SelfVfs> + WriteTo<'t, TargetVfs>,

Source§

impl<'a, 'vfs, T, Vfs: WriteSupportingVfs<'vfs> + 'vfs> WriteTo<'vfs, Vfs> for FmtWrapperRefWr<'a, 'vfs, T, Vfs>
where T: Display + ?Sized, 'vfs: 'a,

Source§

impl<'a, 'vfs, T, Vfs: WriteSupportingVfs<'vfs>> WriteTo<'vfs, Vfs> for CleanDirRefWr<'a, 'vfs, T, Vfs>
where T: ?Sized + WriteTo<'vfs, Vfs>, 'vfs: 'a,

Source§

impl<'a, 'vfs, T, Vfs: WriteSupportingVfs<'vfs>> WriteTo<'vfs, Vfs> for JsonRefWr<'a, 'vfs, T, Vfs>
where T: Serialize + 'a, 'vfs: 'a,

Available on crate feature json only.
Source§

impl<'a, 'vfs, T, Vfs: WriteSupportingVfs<'vfs>> WriteTo<'vfs, Vfs> for JsonPrettyRefWr<'a, 'vfs, T, Vfs>
where T: Serialize + 'a, 'vfs: 'a,

Available on crate feature json only.
Source§

impl<'a, 'vfs, T, Vfs: WriteSupportingVfs<'vfs>> WriteTo<'vfs, Vfs> for RonRefWr<'a, 'vfs, T, Vfs>
where T: Serialize + 'a, 'vfs: 'a,

Available on crate feature ron only.
Source§

impl<'a, 'vfs, T, Vfs: WriteSupportingVfs<'vfs>> WriteTo<'vfs, Vfs> for RonPrettyRefWr<'a, 'vfs, T, Vfs>
where T: Serialize + 'a, 'vfs: 'a,

Available on crate feature ron only.
Source§

impl<'a, 'vfs, T, Vfs: WriteSupportingVfs<'vfs>> WriteTo<'vfs, Vfs> for TomlRefWr<'a, 'vfs, T, Vfs>
where T: Serialize + 'a, 'vfs: 'a,

Available on crate feature toml only.
Source§

impl<'a, 'vfs, T, Vfs: WriteSupportingVfs<'vfs>> WriteTo<'vfs, Vfs> for YamlRefWr<'a, 'vfs, T, Vfs>
where T: Serialize + 'a, 'vfs: 'a,

Available on crate feature yaml only.
Source§

impl<'a, 'vfs, Vfs: VfsWithSeekWrite<'vfs>> WriteTo<'vfs, Vfs> for AvifWriter<'a, Vfs>
where Vfs::WFile: Seek, 'vfs: 'a,

Available on crate features image and image-format-avif only.
Source§

impl<'a, 'vfs, Vfs: VfsWithSeekWrite<'vfs>> WriteTo<'vfs, Vfs> for BmpWriter<'a, Vfs>
where Vfs::WFile: Seek, 'vfs: 'a,

Available on crate features image and image-format-bmp only.
Source§

impl<'a, 'vfs, Vfs: VfsWithSeekWrite<'vfs>> WriteTo<'vfs, Vfs> for FarbfeldWriter<'a, Vfs>
where Vfs::WFile: Seek, 'vfs: 'a,

Available on crate features image and image-format-ff only.
Source§

impl<'a, 'vfs, Vfs: VfsWithSeekWrite<'vfs>> WriteTo<'vfs, Vfs> for GifWriter<'a, Vfs>
where Vfs::WFile: Seek, 'vfs: 'a,

Available on crate features image and image-format-gif only.
Source§

impl<'a, 'vfs, Vfs: VfsWithSeekWrite<'vfs>> WriteTo<'vfs, Vfs> for HdrWriter<'a, Vfs>
where Vfs::WFile: Seek, 'vfs: 'a,

Available on crate features image and image-format-hdr only.
Source§

impl<'a, 'vfs, Vfs: VfsWithSeekWrite<'vfs>> WriteTo<'vfs, Vfs> for IcoWriter<'a, Vfs>
where Vfs::WFile: Seek, 'vfs: 'a,

Available on crate features image and image-format-ico only.
Source§

impl<'a, 'vfs, Vfs: VfsWithSeekWrite<'vfs>> WriteTo<'vfs, Vfs> for JpegWriter<'a, Vfs>
where Vfs::WFile: Seek, 'vfs: 'a,

Available on crate features image and image-format-jpeg only.
Source§

impl<'a, 'vfs, Vfs: VfsWithSeekWrite<'vfs>> WriteTo<'vfs, Vfs> for OpenExrWriter<'a, Vfs>
where Vfs::WFile: Seek, 'vfs: 'a,

Available on crate features image and image-format-exr only.
Source§

impl<'a, 'vfs, Vfs: VfsWithSeekWrite<'vfs>> WriteTo<'vfs, Vfs> for PngWriter<'a, Vfs>
where Vfs::WFile: Seek, 'vfs: 'a,

Available on crate features image and image-format-png only.
Source§

impl<'a, 'vfs, Vfs: VfsWithSeekWrite<'vfs>> WriteTo<'vfs, Vfs> for PnmWriter<'a, Vfs>
where Vfs::WFile: Seek, 'vfs: 'a,

Available on crate features image and image-format-pnm only.
Source§

impl<'a, 'vfs, Vfs: VfsWithSeekWrite<'vfs>> WriteTo<'vfs, Vfs> for QoiWriter<'a, Vfs>
where Vfs::WFile: Seek, 'vfs: 'a,

Available on crate feature image only.
Source§

impl<'a, 'vfs, Vfs: VfsWithSeekWrite<'vfs>> WriteTo<'vfs, Vfs> for TgaWriter<'a, Vfs>
where Vfs::WFile: Seek, 'vfs: 'a,

Available on crate features image and image-format-tga only.
Source§

impl<'a, 'vfs, Vfs: VfsWithSeekWrite<'vfs>> WriteTo<'vfs, Vfs> for TiffWriter<'a, Vfs>
where Vfs::WFile: Seek, 'vfs: 'a,

Available on crate features image and image-format-tiff only.
Source§

impl<'a, 'vfs, Vfs: VfsWithSeekWrite<'vfs>> WriteTo<'vfs, Vfs> for WebPWriter<'a, Vfs>
where Vfs::WFile: Seek, 'vfs: 'a,

Available on crate features image and image-format-webp only.
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, T, F, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for DirChildSingleOpt<T, F, Vfs::Path>
where T: WriteTo<'a, Vfs>, F: Filter<Vfs::Path>,

Source§

impl<'a, T, F, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for DirChildren<T, F, Vfs::Path>
where T: WriteTo<'a, Vfs>, F: Filter<Vfs::Path>,

Source§

impl<'a, T, F, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for ForceCreateDirChildren<T, F, Vfs::Path>
where T: WriteTo<'a, Vfs>, F: Filter<Vfs::Path>,

Source§

impl<'a, T, F: Filter<Vfs::Path>, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for DirChildSingle<T, F, Vfs::Path>
where T: WriteTo<'a, Vfs>,

Source§

impl<'a, T, H, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for VersionedHash<T, Vfs::Path, H>
where T: WriteTo<'a, Vfs> + Hash, Vfs::Path: PartialEq, H: Hasher + Default,

Source§

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

Source§

impl<'a, T, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for Json<T>
where T: Serialize + for<'d> Deserialize<'d> + 'static,

Available on crate feature json only.
Source§

impl<'a, T, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for JsonPretty<T>
where T: Serialize + for<'d> Deserialize<'d> + 'static,

Available on crate feature json only.
Source§

impl<'a, T, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for Ron<T>
where T: Serialize + for<'d> Deserialize<'d> + 'static,

Available on crate feature ron only.
Source§

impl<'a, T, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for RonPretty<T>
where T: Serialize + for<'d> Deserialize<'d> + 'static,

Available on crate feature ron only.
Source§

impl<'a, T, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for Toml<T>
where T: Serialize + for<'d> Deserialize<'d> + 'static,

Available on crate feature toml only.
Source§

impl<'a, T, Vfs: WriteSupportingVfs<'a>> WriteTo<'a, Vfs> for Yaml<T>
where T: Serialize + for<'d> Deserialize<'d> + 'static,

Available on crate feature yaml only.
Source§

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

Source§

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

Source§

impl<'a, Vfs: WriteSupportingVfs<'a>, T: WriteTo<'a, Vfs>> WriteTo<'a, Vfs> for Versioned<T, Vfs::Path>
where Vfs::Path: PartialEq,

Source§

impl<'vfs, T, Vfs> WriteTo<'vfs, Vfs> for AtomicDir<T>
where T: WriteTo<'vfs, Vfs>, Vfs: VfsSupportsTemporaryDirectories<'vfs> + Vfs<'vfs> + WriteSupportingVfs<'vfs> + 'vfs,

Source§

impl<'vfs, T, Vfs: WriteSupportingVfs<'vfs>> WriteTo<'vfs, Vfs> for FmtWrapper<T>
where T: Display,

Source§

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

Source§

impl<'vfs, Vfs: VfsWithSeekWrite<'vfs>, T> WriteTo<'vfs, Vfs> for T
where T: ImgFormat, Vfs::WFile: Seek,

Available on crate feature image only.
Source§

impl<'vfs, Vfs: WriteSupportingVfs<'vfs>, T: WriteTo<'vfs, Vfs> + 'vfs, F: FileFilter<Vfs::Path> + FolderRecurseFilter<Vfs::Path> + FolderFilter<Vfs::Path> + 'vfs> WriteTo<'vfs, Vfs> for DirDescendants<T, F, Vfs::Path>