Trait WriteTo

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

Source

fn write_to(&self, path: &Path) -> Result<()>

Writes the structure to the specified path.

Implementations on Foreign Types§

Source§

impl WriteTo for &str

Source§

fn write_to(&self, path: &Path) -> Result<()>

Source§

impl WriteTo for &[u8]

Source§

fn write_to(&self, path: &Path) -> Result<()>

Source§

impl WriteTo for str

Source§

fn write_to(&self, path: &Path) -> Result<()>

Source§

impl WriteTo for String

Source§

fn write_to(&self, path: &Path) -> Result<()>

Source§

impl WriteTo for Vec<u8>

Source§

fn write_to(&self, path: &Path) -> Result<()>

Source§

impl WriteTo for [u8]

Source§

fn write_to(&self, path: &Path) -> Result<()>

Source§

impl<T> WriteTo for Option<T>
where T: WriteTo,

Source§

fn write_to(&self, path: &Path) -> Result<()>

Implementors§

Source§

impl WriteTo for FileBytes

Source§

impl WriteTo for FileBytesRefWr<'_>

Source§

impl WriteTo for FileStrWr<'_>

Source§

impl WriteTo for FileString

Source§

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

Available on crate feature json only.
Source§

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

Available on crate feature ron only.
Source§

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

Available on crate feature toml only.
Source§

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

Available on crate feature yaml only.
Source§

impl<T> WriteTo for DeferredReadOrOwn<T>
where T: ReadFrom + WriteTo,

Source§

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

Available on crate feature json only.
Source§

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

Available on crate feature ron only.
Source§

impl<T> WriteTo for CleanDir<T>

Source§

impl<T> WriteTo for CleanDirRefWr<'_, T>
where T: ?Sized + DirStructureItem,

Source§

impl<T> WriteTo for DeferredRead<T>
where T: ReadFrom + WriteTo,

Source§

impl<T> WriteTo for FmtWrapper<T>
where T: Display,

Source§

impl<T> WriteTo for FmtWrapperRefWr<'_, T>
where T: Display + ?Sized,

Source§

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

Available on crate feature toml only.
Source§

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

Available on crate feature yaml only.
Source§

impl<T, F> WriteTo for DirChildren<T, F>
where T: DirStructureItem, F: Filter,

Source§

impl<T: DirStructureItem> WriteTo for Versioned<T>