FileSystem

Struct FileSystem 

Source
pub struct FileSystem { /* private fields */ }

Implementations§

Source§

impl FileSystem

Source

pub fn new_format( device: &'static dyn DirectBlockDevice, cache_size: usize, ) -> Result<Self>

Source

pub fn get_or_format( device: &'static dyn DirectBlockDevice, cache_size: usize, ) -> Result<Self>

Source

pub fn new( device: &'static dyn DirectBlockDevice, cache_size: usize, ) -> Result<Self>

Source

pub fn format( device: &'static dyn DirectBlockDevice, cache_size: usize, ) -> Result<()>

Source

pub fn operation<T>( &self, operation: impl FnOnce(&mut lfs_t) -> Result<T>, ) -> Result<T>

Source

pub fn operation_with_context<I: 'static, T>( &self, context: &mut Context, operation: impl FnOnce(&mut lfs_t, &mut I) -> Result<T>, ) -> Result<T>

Trait Implementations§

Source§

impl AttributeOperations for FileSystem

Source§

fn get_attributes( &self, context: &mut Context, attributes: &mut Attributes, ) -> Result<()>

Source§

fn set_attributes( &self, context: &mut Context, attributes: &Attributes, ) -> Result<()>

Source§

impl BaseOperations for FileSystem

Source§

fn read( &self, context: &mut Context, buffer: &mut [u8], absolute_position: Size, ) -> Result<usize>

Read data from the device at the current position. Read more
Source§

fn write( &self, context: &mut Context, buffer: &[u8], absolute_position: Size, ) -> Result<usize>

Write data to the device at the current position. Read more
Source§

fn set_position( &self, context: &mut Context, current_position: Size, position: &Position, ) -> Result<Size>

Set the current position cursor for read/write operations. Read more
Source§

fn flush(&self, context: &mut Context) -> Result<()>

Flush any buffered data to the underlying storage. Read more
Source§

fn clone_context(&self, context: &Context) -> Result<Context>

Source§

fn close(&self, context: &mut Context) -> Result<()>

Source§

fn open(&self, _context: &mut Context) -> Result<(), Error>

Source§

fn read_until( &self, context: &mut Context, buffer: &mut [u8], absolute_position: u64, delimiter: &[u8], ) -> Result<usize, Error>

Source§

fn write_pattern( &self, context: &mut Context, pattern: &[u8], count: usize, absolute_position: u64, ) -> Result<usize, Error>

Source§

fn write_vectored( &self, context: &mut Context, buffers: &[&[u8]], absolute_position: u64, ) -> Result<usize, Error>

Source§

fn control( &self, _context: &mut Context, _command: ControlCommandIdentifier, _input: &AnyByLayout, _output: &mut AnyByLayout, ) -> Result<(), Error>

Source§

impl DirectoryOperations for FileSystem

Source§

fn read(&self, context: &mut Context) -> Result<Option<Entry>>

Source§

fn get_position(&self, context: &mut Context) -> Result<Size>

Source§

fn set_position(&self, context: &mut Context, position: Size) -> Result<()>

Source§

fn rewind(&self, context: &mut Context) -> Result<()>

Source§

fn close(&self, context: &mut Context) -> Result<()>

Source§

impl Drop for FileSystem

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl FileSystemOperations for FileSystem

Source§

fn rename(&self, source: &Path, destination: &Path) -> Result<()>

Rename or move a file or directory. Read more
Source§

fn remove(&self, path: &Path) -> Result<()>

Remove a file or directory from the file system. Read more
Source§

fn create_directory(&self, path: &Path) -> Result<()>

Source§

fn lookup_directory(&self, context: &mut Context, path: &Path) -> Result<()>

Source§

fn lookup_file( &self, context: &mut Context, path: &Path, flags: Flags, ) -> Result<()>

Source§

fn create_file(&self, path: &Path) -> Result<()>

Source§

fn get_attributes(&self, path: &Path, attributes: &mut Attributes) -> Result<()>

Source§

fn set_attributes(&self, path: &Path, attributes: &Attributes) -> Result<()>

Source§

impl MountOperations for FileSystem

Source§

fn unmount(&self) -> Result<()>

Source§

fn mount(&self) -> Result<(), Error>

Source§

impl FileOperations for FileSystem

Source§

impl Send for FileSystem

Source§

impl Sync for FileSystem

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, 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.