ReadFrom

Trait ReadFrom 

Source
pub trait ReadFrom<'vfs, Vfs: Vfs<'vfs> + ?Sized>: Sized + 'vfs {
    // Required method
    fn read_from(path: &Vfs::Path, vfs: Pin<&'vfs Vfs>) -> VfsResult<Self, Vfs>;
}
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: &Vfs::Path, vfs: Pin<&'vfs Vfs>) -> VfsResult<Self, Vfs>

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, T, Vfs: Vfs<'a>> ReadFrom<'a, Vfs> for Option<T>
where T: ReadFrom<'a, Vfs>,

Source§

fn read_from(path: &Vfs::Path, vfs: Pin<&'a Vfs>) -> VfsResult<Self, Vfs>
where Self: Sized,

Source§

impl<'a, T: 'a, Vfs: Vfs<'a>> ReadFrom<'a, Vfs> for PhantomData<T>

Source§

fn read_from(_path: &Vfs::Path, _vfs: Pin<&'a Vfs>) -> VfsResult<Self, Vfs>
where Self: Sized,

Source§

impl<'a, Vfs: Vfs<'a>> ReadFrom<'a, Vfs> for ()

Source§

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

Source§

impl<'a, Vfs: Vfs<'a>> ReadFrom<'a, Vfs> for String

Source§

fn read_from(path: &Vfs::Path, vfs: Pin<&'a Vfs>) -> VfsResult<Self, Vfs>
where Self: Sized,

Source§

impl<'a, Vfs: Vfs<'a>> ReadFrom<'a, Vfs> for Vec<u8>

Source§

fn read_from(path: &Vfs::Path, vfs: Pin<&'a Vfs>) -> VfsResult<Self, Vfs>
where Self: Sized,

Source§

impl<'vfs, Vfs: VfsWithSeekRead<'vfs>> ReadFrom<'vfs, Vfs> for DynamicImage
where Vfs::RFile: Seek,

Available on crate feature image only.
Source§

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

Implementors§

Source§

impl<'a, T, F, Vfs: Vfs<'a>> ReadFrom<'a, Vfs> for DirChildSingleOpt<T, F, Vfs::Path>
where T: ReadFrom<'a, Vfs>, F: Filter<Vfs::Path> + 'a,

Source§

impl<'a, T, F, Vfs: Vfs<'a>> ReadFrom<'a, Vfs> for DirChildSingle<T, F, Vfs::Path>
where T: ReadFrom<'a, Vfs>, F: Filter<Vfs::Path> + 'a,

Source§

impl<'a, T, F, Vfs: Vfs<'a>> ReadFrom<'a, Vfs> for ForceCreateDirChildren<T, F, Vfs::Path>
where T: ReadFrom<'a, Vfs>, F: Filter<Vfs::Path> + 'a,

Source§

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

Source§

impl<'a, T, P: PathType + ?Sized + 'a, F, Vfs: Vfs<'a, Path = P>> ReadFrom<'a, Vfs> for DirChildren<T, F, P>
where T: ReadFrom<'a, Vfs>, F: 'a + Filter<P>,

Source§

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

Source§

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

Available on crate feature json only.
Source§

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

Available on crate feature json only.
Source§

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

Available on crate feature ron only.
Source§

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

Available on crate feature ron only.
Source§

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

Available on crate feature toml only.
Source§

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

Available on crate feature yaml only.
Source§

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

Source§

impl<'a, Vfs: Vfs<'a>> ReadFrom<'a, Vfs> for FileBytes

Source§

impl<'a, Vfs: Vfs<'a>> ReadFrom<'a, Vfs> for FileString

Source§

impl<'a, Vfs: Vfs<'a>, T> ReadFrom<'a, Vfs> for Versioned<T, Vfs::Path>
where T: ReadFrom<'a, Vfs>,

Source§

impl<'a, const CHECK_ON_READ: bool, T, Vfs: Vfs<'a>> ReadFrom<'a, Vfs> for DeferredReadOrOwn<'a, T, Vfs, CHECK_ON_READ>
where T: ReadFrom<'a, Vfs>,

Source§

impl<'a, const CHECK_ON_READ: bool, T, Vfs: Vfs<'a>> ReadFrom<'a, Vfs> for DeferredRead<'a, T, Vfs, CHECK_ON_READ>
where T: ReadFrom<'a, Vfs>,

Source§

impl<'vfs, T, Vfs: Vfs<'vfs> + 'vfs> ReadFrom<'vfs, Vfs> for AtomicDir<T>
where T: ReadFrom<'vfs, Vfs>,

Source§

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

Source§

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

Source§

impl<'vfs, Vfs: VfsWithSeekRead<'vfs>, T> ReadFrom<'vfs, Vfs> for T
where T: ImgFormat + 'vfs, Vfs::RFile: Seek,

Available on crate feature image only.