pub struct MockFileProvider { /* private fields */ }Expand description
Mock file provider for testing
This provider stores files in memory, allowing tests to run without filesystem access.
Implementations§
Source§impl MockFileProvider
impl MockFileProvider
Sourcepub fn with_file(self, path: &str, content: impl Into<Vec<u8>>) -> Self
pub fn with_file(self, path: &str, content: impl Into<Vec<u8>>) -> Self
Add a file to the mock filesystem
Sourcepub fn with_text_file(self, path: &str, content: &str) -> Self
pub fn with_text_file(self, path: &str, content: &str) -> Self
Add a text file to the mock filesystem
Sourcepub fn with_files(
self,
files: impl IntoIterator<Item = (&'static str, &'static str)>,
) -> Self
pub fn with_files( self, files: impl IntoIterator<Item = (&'static str, &'static str)>, ) -> Self
Add multiple files at once
Trait Implementations§
Source§impl Clone for MockFileProvider
impl Clone for MockFileProvider
Source§fn clone(&self) -> MockFileProvider
fn clone(&self) -> MockFileProvider
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MockFileProvider
impl Debug for MockFileProvider
Source§impl Default for MockFileProvider
impl Default for MockFileProvider
Source§fn default() -> MockFileProvider
fn default() -> MockFileProvider
Returns the “default value” for a type. Read more
Source§impl FileProvider for MockFileProvider
impl FileProvider for MockFileProvider
Auto Trait Implementations§
impl Freeze for MockFileProvider
impl RefUnwindSafe for MockFileProvider
impl Send for MockFileProvider
impl Sync for MockFileProvider
impl Unpin for MockFileProvider
impl UnwindSafe for MockFileProvider
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)