Trait ReadFrom

Source
pub trait ReadFrom {
    // Required method
    fn read_from(path: &Path) -> Result<Self>
       where Self: Sized;
}
Expand description

Trait for types / structures that can be read from disk, either from a file or a directory.

Required Methods§

Source

fn read_from(path: &Path) -> Result<Self>
where Self: Sized,

Reads the structure from the specified path, which can be either a file or a directory.

Implementations on Foreign Types§

Source§

impl ReadFrom for String

Source§

fn read_from(path: &Path) -> Result<Self>
where Self: Sized,

Source§

impl ReadFrom for Vec<u8>

Source§

fn read_from(path: &Path) -> Result<Self>
where Self: Sized,

Source§

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

Source§

fn read_from(path: &Path) -> Result<Self>
where Self: Sized,

Implementors§

Source§

impl ReadFrom for FileBytes

Source§

impl ReadFrom for FileString

Source§

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

Source§

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

Available on crate feature json only.
Source§

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

Available on crate feature ron only.
Source§

impl<T> ReadFrom for CleanDir<T>

Source§

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

Source§

impl<T> ReadFrom for FmtWrapper<T>
where T: FromStr, T::Err: Into<Box<dyn Error + Send + Sync>>,

Source§

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

Available on crate feature toml only.
Source§

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

Available on crate feature yaml only.
Source§

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

Source§

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