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 fn create_directory(&self, path: PathBuf) -> Result<()>
pub fn create_directory(&self, path: PathBuf) -> Result<()>
Create a directory in the virtual filesystem
Sourcepub fn remove_directory(&self, path: &Path) -> Result<()>
pub fn remove_directory(&self, path: &Path) -> Result<()>
Remove a directory (must be empty)
Sourcepub fn directory_exists(&self, path: &Path) -> bool
pub fn directory_exists(&self, path: &Path) -> bool
Check if a directory exists
Sourcepub fn is_directory_empty(&self, path: &Path) -> bool
pub fn is_directory_empty(&self, path: &Path) -> bool
Check if a directory is empty (no files or subdirectories inside)
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 · Source§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 UnsafeUnpin 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,
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