pub struct EmbeddedFS<T> where
T: RustEmbed + Send + Sync + Debug + 'static, { /* private fields */ }
Expand description
a read-only file system embedded in the executable
see rust-embed for how to create a RustEmbed
Implementations
Trait Implementations
sourceimpl<T> FileSystem for EmbeddedFS<T> where
T: RustEmbed + Send + Sync + Debug + 'static,
impl<T> FileSystem for EmbeddedFS<T> where
T: RustEmbed + Send + Sync + Debug + 'static,
sourcefn read_dir(&self, path: &str) -> VfsResult<Box<dyn Iterator<Item = String>>>
fn read_dir(&self, path: &str) -> VfsResult<Box<dyn Iterator<Item = String>>>
Iterates over all direct children of this directory path NOTE: the returned String items denote the local bare filenames, i.e. they should not contain “/” anywhere Read more
sourcefn create_dir(&self, _path: &str) -> VfsResult<()>
fn create_dir(&self, _path: &str) -> VfsResult<()>
Creates the directory at this path Read more
sourcefn open_file(&self, path: &str) -> VfsResult<Box<dyn SeekAndRead>>
fn open_file(&self, path: &str) -> VfsResult<Box<dyn SeekAndRead>>
Opens the file at this path for reading
sourcefn create_file(&self, _path: &str) -> VfsResult<Box<dyn Write>>
fn create_file(&self, _path: &str) -> VfsResult<Box<dyn Write>>
Creates a file at this path for writing
sourcefn append_file(&self, _path: &str) -> VfsResult<Box<dyn Write>>
fn append_file(&self, _path: &str) -> VfsResult<Box<dyn Write>>
Opens the file at this path for appending
sourcefn metadata(&self, path: &str) -> VfsResult<VfsMetadata>
fn metadata(&self, path: &str) -> VfsResult<VfsMetadata>
Returns the file metadata for the file at this path
sourcefn exists(&self, path: &str) -> VfsResult<bool>
fn exists(&self, path: &str) -> VfsResult<bool>
Returns true if a file or directory at path exists, false otherwise
sourcefn remove_file(&self, _path: &str) -> VfsResult<()>
fn remove_file(&self, _path: &str) -> VfsResult<()>
Removes the file at this path
sourcefn remove_dir(&self, _path: &str) -> VfsResult<()>
fn remove_dir(&self, _path: &str) -> VfsResult<()>
Removes the directory at this path
sourcefn copy_file(&self, _src: &str, _dest: &str) -> VfsResult<()>
fn copy_file(&self, _src: &str, _dest: &str) -> VfsResult<()>
Copies the src path to the destination path within the same filesystem (optional)
Auto Trait Implementations
impl<T> RefUnwindSafe for EmbeddedFS<T> where
T: RefUnwindSafe,
impl<T> Send for EmbeddedFS<T>
impl<T> Sync for EmbeddedFS<T>
impl<T> Unpin for EmbeddedFS<T> where
T: Unpin,
impl<T> UnwindSafe for EmbeddedFS<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more