pub struct IncludeDirVfs { /* private fields */ }
Expand description
A Vfs
implementation with an include_dir::Dir
directory.
Implementations§
Source§impl IncludeDirVfs
impl IncludeDirVfs
Sourcepub fn new(dir: Dir<'static>) -> Self
pub fn new(dir: Dir<'static>) -> Self
Creates a new IncludeDirVfs
.
Trait Implementations§
Source§impl<'vfs> Vfs<'vfs> for IncludeDirVfs
impl<'vfs> Vfs<'vfs> for IncludeDirVfs
Source§type DirWalk<'a> = IncludeDirWalker<'a>
where
Self: 'a,
'vfs: 'a
type DirWalk<'a> = IncludeDirWalker<'a> where Self: 'a, 'vfs: 'a
The type of the directory walker returned by the
walk_dir
method. Read moreSource§type RFile = Cursor<&'static [u8]>
type RFile = Cursor<&'static [u8]>
The type of the file returned by the
open_read
method. This allows us to
read a file in chunks, which might be required for some certain file formats. Read moreSource§fn open_read(self: Pin<&Self>, path: &Path) -> VfsResult<Self::RFile, Self>
fn open_read(self: Pin<&Self>, path: &Path) -> VfsResult<Self::RFile, Self>
Opens a file for reading, at the specified path.
Source§fn read_string(self: Pin<&Self>, path: &Path) -> VfsResult<String, Self>
fn read_string(self: Pin<&Self>, path: &Path) -> VfsResult<String, Self>
Reads the contents of a file, at the specified path, and returns it as a string. Read more
Source§fn exists(self: Pin<&Self>, path: &Path) -> VfsResult<bool, Self>
fn exists(self: Pin<&Self>, path: &Path) -> VfsResult<bool, Self>
Checks if a file exists at the specified path.
Auto Trait Implementations§
impl Freeze for IncludeDirVfs
impl RefUnwindSafe for IncludeDirVfs
impl Send for IncludeDirVfs
impl Sync for IncludeDirVfs
impl Unpin for IncludeDirVfs
impl UnwindSafe for IncludeDirVfs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more