pub struct VirtualFileSystem { /* private fields */ }Expand description
Virtual File System for FTP server
Implementations§
Source§impl VirtualFileSystem
impl VirtualFileSystem
pub fn new(root: PathBuf) -> Self
pub fn add_file(&self, path: PathBuf, file: VirtualFile) -> Result<()>
pub fn get_file(&self, path: &Path) -> Option<VirtualFile>
pub fn remove_file(&self, path: &Path) -> Result<()>
pub fn list_files(&self, path: &Path) -> Vec<VirtualFile>
pub fn clear(&self) -> Result<()>
pub fn add_fixture(&self, fixture: FileFixture) -> Result<()>
pub fn load_fixtures(&self, fixtures: Vec<FileFixture>) -> Result<()>
Sourcepub async fn add_file_async(
&self,
path: PathBuf,
file: VirtualFile,
) -> Result<()>
pub async fn add_file_async( &self, path: PathBuf, file: VirtualFile, ) -> Result<()>
Async version of add_file - use this in async contexts
Sourcepub async fn get_file_async(&self, path: &Path) -> Option<VirtualFile>
pub async fn get_file_async(&self, path: &Path) -> Option<VirtualFile>
Async version of get_file - use this in async contexts
Trait Implementations§
Source§impl Clone for VirtualFileSystem
impl Clone for VirtualFileSystem
Source§fn clone(&self) -> VirtualFileSystem
fn clone(&self) -> VirtualFileSystem
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 moreAuto Trait Implementations§
impl Freeze for VirtualFileSystem
impl !RefUnwindSafe for VirtualFileSystem
impl Send for VirtualFileSystem
impl Sync for VirtualFileSystem
impl Unpin for VirtualFileSystem
impl !UnwindSafe for VirtualFileSystem
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§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)