Skip to main content

FileSystem

Struct FileSystem 

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

Implementations§

Source§

impl FileSystem

Source

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

Source

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

Source

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

Source

pub fn format( device: &'static dyn DirectBlockDevice, options: Options, ) -> 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<()>

Populate the requested attributes for the open file or directory. Read more
Source§

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

Change the fields selected by attributes.get_mask(). Read more
Source§

impl BaseOperations for FileSystem

Source§

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

Source§

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

Source§

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

Source§

fn flush( &self, context: &mut Context, _cx: &mut Context<'_>, ) -> Poll<Result<()>>

Source§

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

Source§

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

§

fn control( &self, _context: &mut Context, _cx: &mut Context<'_>, _command: ControlCommandIdentifier, _input: &AnyByLayout, _output: &mut AnyByLayout, ) -> Poll<Result<(), Kind>>

§

fn read_until( &self, context: &mut Context, cx: &mut Context<'_>, buffer: &mut [u8], absolute_position: u64, delimiter: &[u8], ) -> Poll<Result<usize, Kind>>

§

fn write_pattern( &self, context: &mut Context, cx: &mut Context<'_>, pattern: &[u8], count: usize, absolute_position: u64, ) -> Poll<Result<usize, Kind>>

§

fn write_vectored( &self, context: &mut Context, cx: &mut Context<'_>, buffers: &[&[u8]], absolute_position: u64, ) -> Poll<Result<usize, Kind>>

§

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

§

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

§

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

§

fn control_sync( &self, context: &mut Context, command: ControlCommandIdentifier, input: &AnyByLayout, output: &mut AnyByLayout, ) -> Result<(), Kind>

§

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

§

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

§

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

§

fn cancel_operation(&self, _context: &mut Context, _operation: Operation)

Detach this opening’s registration after completion, error or cancellation. This hook is idempotent and must not consume data or change the cursor. Wake and drop retired wakers outside device locks.
§

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

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§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl FileSystemOperations for FileSystem

Source§

fn supports_confined_namespace(&self) -> bool

Return whether this backend enforces confined, non-following namespace semantics for operations beneath a directory root. Read more
Source§

fn writable_attributes(&self) -> AttributeFlags

Return the fields this backend can accept through set_attributes. Read more
Source§

fn persistent_attributes(&self) -> AttributeFlags

Return the fields that are stored durably by this filesystem. Read more
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, attributes: &Attributes) -> Result<()>

Create a directory at path, persisting attributes with the new entry in the same commit as the entry creation where the backend can. Read more
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, attributes: &Attributes) -> Result<()>

Create a regular file at path, persisting attributes with the new entry in the same commit as the entry creation where the backend can. Read more
Source§

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

Populate the requested attributes for a path. Read more
Source§

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

Change the fields selected by attributes.get_mask() for a path. Read more
§

fn supports_directory_entry_operations(&self) -> bool

Return whether this backend operates on single normal entry names relative to an already-opened directory [Context]. Read more
§

fn lookup_directory_entry( &self, _parent: &Context, _name: &str, _context: &mut Context, ) -> Result<(), Kind>

Open a child directory entry name inside the opened parent directory into context, without following symbolic links. Read more
§

fn lookup_file_entry( &self, _parent: &Context, _name: &str, _context: &mut Context, _flags: Flags, ) -> Result<(), Kind>

Open a child regular file name inside the opened parent directory into context, without following symbolic links.
§

fn create_directory_entry( &self, _parent: &Context, _name: &str, _attributes: &Attributes, ) -> Result<(), Kind>

Create a child directory name inside the opened parent directory, persisting attributes with the new entry where the backend can.
§

fn create_file_entry( &self, _parent: &Context, _name: &str, _attributes: &Attributes, ) -> Result<(), Kind>

Create a child regular file name inside the opened parent directory, persisting attributes with the new entry where the backend can.
§

fn remove_entry(&self, _parent: &Context, _name: &str) -> Result<(), Kind>

Remove a child entry name inside the opened parent directory without following symbolic links.
§

fn rename_entry( &self, _source_parent: &Context, _source_name: &str, _destination_parent: &Context, _destination_name: &str, ) -> Result<(), Kind>

Rename source_name inside source_parent to destination_name inside destination_parent without following symbolic links.
§

fn link_entry( &self, _existing_parent: &Context, _existing_name: &str, _new_parent: &Context, _new_name: &str, ) -> Result<(), Kind>

Create new_name inside new_parent as a hard link to existing_name inside existing_parent without following symbolic links.
§

fn create_symlink_entry( &self, _target: &Path, _parent: &Context, _name: &str, _attributes: &Attributes, ) -> Result<(), Kind>

Create a symbolic link named name inside the opened parent directory pointing to target, persisting attributes with the new entry where the backend can.
§

fn read_symlink_entry( &self, _parent: &Context, _name: &str, _buffer: &mut [u8], ) -> Result<usize, Kind>

Read the target of symbolic link name inside the opened parent directory into buffer without following it.
§

fn get_entry_attributes( &self, _parent: &Context, _name: &str, _attributes: &mut Attributes, ) -> Result<(), Kind>

Populate attributes for child entry name inside the opened parent directory without following symbolic links.
§

fn set_entry_attributes( &self, _parent: &Context, _name: &str, _attributes: &Attributes, ) -> Result<(), Kind>

Update attributes for child entry name inside the opened parent directory without following symbolic links.
Create a symbolic link without resolving its target, persisting attributes with the new entry where the backend can. Backends that do not support native links or a durable Xila link representation may keep the default implementation.
Create new as an additional directory entry for the existing, non-directory object at existing, sharing its data. Backends without hard links (including LittleFS) keep the default implementation, which reports [crate::IoErrorKind::Unsupported].
Copy the stored target of a symbolic link into a caller-owned buffer. This operation must inspect the final directory entry without following it.
Source§

impl MountOperations for FileSystem

Source§

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

Without open handles, sync the backing device, then lfs_unmount and release the configuration; a failed sync leaves the filesystem mounted. With open handles (a forced detach), only stop serving: their caches stay allocated and their unsynchronized data is not committed.

§

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

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.