pub struct FileSystem {
pub storage: Box<dyn Storage>,
/* private fields */
}
Fields§
§storage: Box<dyn Storage>
Implementations§
Source§impl FileSystem
impl FileSystem
pub fn new(storage: Box<dyn Storage>) -> Result<Self, Error>
pub fn get_storage_version(&self) -> u32
pub fn root_fd(&self) -> Fd
pub fn root_path(&self) -> &str
pub fn advice( &mut self, fd: Fd, _offset: FileSize, _len: FileSize, _advice: Advice, ) -> Result<(), Error>
pub fn allocate( &mut self, fd: Fd, _offset: FileSize, _additional_size: FileSize, ) -> Result<(), Error>
pub fn close(&mut self, fd: Fd) -> Result<(), Error>
pub fn flush(&mut self, fd: Fd) -> Result<(), Error>
pub fn renumber(&mut self, from: Fd, to: Fd) -> Result<(), Error>
pub fn mount_memory_file( &mut self, filename: &str, memory: Box<dyn Memory>, ) -> Result<(), Error>
pub fn init_memory_file(&mut self, filename: &str) -> Result<(), Error>
pub fn store_memory_file(&mut self, filename: &str) -> Result<(), Error>
pub fn unmount_memory_file( &mut self, filename: &str, ) -> Result<Box<dyn Memory>, Error>
pub fn get_direntry( &self, fd: Fd, index: DirEntryIndex, ) -> Result<DirEntry, Error>
pub fn get_direntries( &self, fd: Fd, initial_index: Option<DirEntryIndex>, ) -> Result<Vec<(DirEntryIndex, DirEntry)>, Error>
pub fn read(&mut self, fd: Fd, dst: &mut [u8]) -> Result<FileSize, Error>
pub fn read_vec(&mut self, fd: Fd, dst: DstIoVec<'_>) -> Result<FileSize, Error>
pub fn read_vec_with_offset( &mut self, fd: Fd, dst: DstIoVec<'_>, offset: FileSize, ) -> Result<FileSize, Error>
pub fn write(&mut self, fd: Fd, src: &[u8]) -> Result<FileSize, Error>
pub fn write_vec( &mut self, fd: Fd, src: SrcIoVec<'_>, ) -> Result<FileSize, Error>
pub fn write_vec_with_offset( &mut self, fd: Fd, src: SrcIoVec<'_>, offset: FileSize, ) -> Result<FileSize, Error>
pub fn seek( &mut self, fd: Fd, delta: i64, whence: Whence, ) -> Result<FileSize, Error>
pub fn tell(&mut self, fd: Fd) -> Result<FileSize, Error>
pub fn metadata_from_node(&self, node: Node) -> Result<Metadata, Error>
pub fn metadata(&self, fd: Fd) -> Result<Metadata, Error>
pub fn set_metadata(&mut self, fd: Fd, metadata: Metadata) -> Result<(), Error>
pub fn set_file_size(&mut self, fd: Fd, new_size: FileSize) -> Result<(), Error>
pub fn set_file_size_limit( &mut self, fd: Fd, max_size: FileSize, ) -> Result<(), Error>
pub fn set_accessed_time(&mut self, fd: Fd, time: u64) -> Result<(), Error>
pub fn set_modified_time(&mut self, fd: Fd, time: u64) -> Result<(), Error>
pub fn get_stat(&self, fd: Fd) -> Result<(FileType, FdStat), Error>
pub fn set_stat(&mut self, fd: Fd, stat: FdStat) -> Result<(), Error>
pub fn open_metadata( &mut self, parent: Fd, path: &str, ) -> Result<Metadata, Error>
pub fn open( &mut self, parent_fd: Fd, path: &str, stat: FdStat, flags: OpenFlags, ctime: u64, ) -> Result<Fd, Error>
pub fn remove_file(&mut self, parent: Fd, path: &str) -> Result<(), Error>
pub fn mkdir( &mut self, parent: Fd, path: &str, stat: FdStat, ctime: u64, ) -> Result<(), Error>
pub fn create_open_directory( &mut self, parent: Fd, path: &str, stat: FdStat, ctime: u64, ) -> Result<Fd, Error>
pub fn remove_dir(&mut self, parent: Fd, path: &str) -> Result<(), Error>
Sourcepub fn remove_recursive(&mut self, parent: Fd, path: &str) -> Result<(), Error>
pub fn remove_recursive(&mut self, parent: Fd, path: &str) -> Result<(), Error>
A convenience method to recursively remove a directory (and all subdirectories/files within) or delete a file, if the entry is a file.
pub fn create_hard_link( &mut self, old_fd: Fd, old_path: &str, new_fd: Fd, new_path: &str, ) -> Result<Fd, Error>
pub fn rename( &mut self, old_fd: Fd, old_path: &str, new_fd: Fd, new_path: &str, ) -> Result<Fd, Error>
Auto Trait Implementations§
impl Freeze for FileSystem
impl !RefUnwindSafe for FileSystem
impl !Send for FileSystem
impl !Sync for FileSystem
impl Unpin for FileSystem
impl !UnwindSafe for FileSystem
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