Struct stable_fs::fs::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 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 read(&mut self, fd: Fd, dst: &mut [u8]) -> Result<FileSize, Error>

source

pub fn write(&mut self, fd: Fd, src: &[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_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 close(&mut self, fd: Fd) -> Result<(), 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_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(&self, parent: Fd, path: &str) -> Result<Metadata, Error>

source

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

source

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

source

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

source

pub fn create_dir( &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 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.