pub trait WriteTo {
// Required method
fn write_to(&self, path: &Path) -> Result<()>;
}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§
Implementations on Foreign Types§
Implementors§
impl WriteTo for FileBytes
impl WriteTo for FileBytesRefWr<'_>
impl WriteTo for FileStrWr<'_>
impl WriteTo for FileString
impl<'a, T> WriteTo for JsonRefWr<'a, T>where
T: Serialize + 'a,
Available on crate feature
json only.impl<'a, T> WriteTo for RonRefWr<'a, T>where
T: Serialize + 'a,
Available on crate feature
ron only.impl<'a, T> WriteTo for TomlRefWr<'a, T>where
T: Serialize + 'a,
Available on crate feature
toml only.impl<'a, T> WriteTo for YamlRefWr<'a, T>where
T: Serialize + 'a,
Available on crate feature
yaml only.impl<T> WriteTo for DeferredReadOrOwn<T>
impl<T> WriteTo for Json<T>where
T: Serialize + for<'d> Deserialize<'d> + 'static,
Available on crate feature
json only.impl<T> WriteTo for Ron<T>where
T: Serialize + for<'d> Deserialize<'d> + 'static,
Available on crate feature
ron only.impl<T> WriteTo for CleanDir<T>where
T: DirStructureItem,
impl<T> WriteTo for CleanDirRefWr<'_, T>where
T: ?Sized + DirStructureItem,
impl<T> WriteTo for DeferredRead<T>
impl<T> WriteTo for FmtWrapper<T>where
T: Display,
impl<T> WriteTo for FmtWrapperRefWr<'_, T>
impl<T> WriteTo for Toml<T>where
T: Serialize + for<'d> Deserialize<'d> + 'static,
Available on crate feature
toml only.impl<T> WriteTo for Yaml<T>where
T: Serialize + for<'d> Deserialize<'d> + 'static,
Available on crate feature
yaml only.