Skip to main content

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".

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,

Implementors§

Source§

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

Source§

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