Struct FileSystem

Source
pub struct FileSystem {
    pub storage: Box<dyn Storage>,
    /* private fields */
}

Fields§

§storage: Box<dyn Storage>

Implementations§

Source§

impl FileSystem

Source

pub fn new(storage: Box<dyn Storage>) -> Result<Self, Error>

Source

pub fn get_storage_version(&self) -> u32

Source

pub fn root_fd(&self) -> Fd

Source

pub fn root_path(&self) -> &str

Source

pub fn advice( &mut self, fd: Fd, _offset: FileSize, _len: FileSize, _advice: Advice, ) -> Result<(), Error>

Source

pub fn allocate( &mut self, fd: Fd, _offset: FileSize, _additional_size: FileSize, ) -> Result<(), Error>

Source

pub fn close(&mut self, fd: Fd) -> Result<(), Error>

Source

pub fn flush(&mut self, fd: Fd) -> Result<(), Error>

Source

pub fn renumber(&mut self, from: Fd, to: Fd) -> Result<(), Error>

Source

pub fn mount_memory_file( &mut self, filename: &str, memory: Box<dyn Memory>, ) -> Result<(), Error>

Source

pub fn init_memory_file(&mut self, filename: &str) -> Result<(), Error>

Source

pub fn store_memory_file(&mut self, filename: &str) -> Result<(), Error>

Source

pub fn unmount_memory_file( &mut self, filename: &str, ) -> Result<Box<dyn Memory>, Error>

Source

pub fn get_direntry( &self, fd: Fd, index: DirEntryIndex, ) -> Result<DirEntry, Error>

Source

pub fn get_direntries( &self, fd: Fd, initial_index: Option<DirEntryIndex>, ) -> Result<Vec<(DirEntryIndex, DirEntry)>, Error>

Source

pub fn read(&mut self, fd: Fd, dst: &mut [u8]) -> Result<FileSize, Error>

Source

pub fn read_vec(&mut self, fd: Fd, dst: DstIoVec<'_>) -> Result<FileSize, Error>

Source

pub fn read_vec_with_offset( &mut self, fd: Fd, dst: DstIoVec<'_>, offset: FileSize, ) -> Result<FileSize, Error>

Source

pub fn write(&mut self, fd: Fd, src: &[u8]) -> Result<FileSize, Error>

Source

pub fn write_vec( &mut self, fd: Fd, src: SrcIoVec<'_>, ) -> Result<FileSize, Error>

Source

pub fn write_vec_with_offset( &mut self, fd: Fd, src: SrcIoVec<'_>, offset: FileSize, ) -> Result<FileSize, Error>

Source

pub fn seek( &mut self, fd: Fd, delta: i64, whence: Whence, ) -> Result<FileSize, Error>

Source

pub fn tell(&mut self, fd: Fd) -> Result<FileSize, Error>

Source

pub fn metadata_from_node(&self, node: Node) -> Result<Metadata, Error>

Source

pub fn metadata(&self, fd: Fd) -> Result<Metadata, Error>

Source

pub fn set_metadata(&mut self, fd: Fd, metadata: Metadata) -> Result<(), Error>

Source

pub fn set_file_size(&mut self, fd: Fd, new_size: FileSize) -> Result<(), Error>

Source

pub fn set_file_size_limit( &mut self, fd: Fd, max_size: FileSize, ) -> Result<(), Error>

Source

pub fn set_accessed_time(&mut self, fd: Fd, time: u64) -> Result<(), Error>

Source

pub fn set_modified_time(&mut self, fd: Fd, time: u64) -> Result<(), Error>

Source

pub fn get_stat(&self, fd: Fd) -> Result<(FileType, FdStat), Error>

Source

pub fn set_stat(&mut self, fd: Fd, stat: FdStat) -> Result<(), Error>

Source

pub fn open_metadata( &mut self, parent: Fd, path: &str, ) -> Result<Metadata, Error>

Source

pub fn open( &mut self, parent_fd: Fd, path: &str, stat: FdStat, flags: OpenFlags, ctime: u64, ) -> Result<Fd, Error>

Source

pub fn remove_file(&mut self, parent: Fd, path: &str) -> Result<(), Error>

Source

pub fn mkdir( &mut self, parent: Fd, path: &str, stat: FdStat, ctime: u64, ) -> Result<(), Error>

Source

pub fn create_open_directory( &mut self, parent: Fd, path: &str, stat: FdStat, ctime: u64, ) -> Result<Fd, Error>

Source

pub fn remove_dir(&mut self, parent: Fd, path: &str) -> Result<(), Error>

Source

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.

Source

pub fn rename( &mut self, old_fd: Fd, old_path: &str, new_fd: Fd, new_path: &str, ) -> Result<Fd, Error>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.