pub struct FileSystem { /* private fields */ }Implementations§
Source§impl FileSystem
impl FileSystem
pub fn new_format( device: &'static dyn DirectBlockDevice, options: Options, ) -> Result<Self>
pub fn get_or_format( device: &'static dyn DirectBlockDevice, options: Options, ) -> Result<Self>
pub fn new( device: &'static dyn DirectBlockDevice, options: Options, ) -> Result<Self>
pub fn format( device: &'static dyn DirectBlockDevice, options: Options, ) -> Result<()>
pub fn operation<T>( &self, operation: impl FnOnce(&mut lfs_t) -> Result<T>, ) -> Result<T>
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
impl AttributeOperations for FileSystem
Source§fn get_attributes(
&self,
context: &mut Context,
attributes: &mut Attributes,
) -> Result<()>
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<()>
fn set_attributes( &self, context: &mut Context, attributes: &Attributes, ) -> Result<()>
Change the fields selected by
attributes.get_mask(). Read moreSource§impl BaseOperations for FileSystem
impl BaseOperations for FileSystem
fn read( &self, context: &mut Context, _cx: &mut Context<'_>, buffer: &mut [u8], absolute_position: Size, ) -> Poll<Result<usize>>
fn write( &self, context: &mut Context, _cx: &mut Context<'_>, buffer: &[u8], absolute_position: Size, ) -> Poll<Result<usize>>
fn set_position( &self, context: &mut Context, current_position: Size, position: &Position, ) -> Result<Size>
fn flush( &self, context: &mut Context, _cx: &mut Context<'_>, ) -> Poll<Result<()>>
fn clone_context(&self, context: &Context) -> Result<Context>
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)
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
impl DirectoryOperations for FileSystem
fn read(&self, context: &mut Context) -> Result<Option<Entry>>
fn get_position(&self, context: &mut Context) -> Result<Size>
fn set_position(&self, context: &mut Context, position: Size) -> Result<()>
fn rewind(&self, context: &mut Context) -> Result<()>
fn close(&self, context: &mut Context) -> Result<()>
Source§impl Drop for FileSystem
impl Drop for FileSystem
Source§impl FileSystemOperations for FileSystem
impl FileSystemOperations for FileSystem
Source§fn supports_confined_namespace(&self) -> bool
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
fn writable_attributes(&self) -> AttributeFlags
Return the fields this backend can accept through
set_attributes. Read moreSource§fn persistent_attributes(&self) -> AttributeFlags
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<()>
fn rename(&self, source: &Path, destination: &Path) -> Result<()>
Rename or move a file or directory. Read more
Source§fn remove(&self, path: &Path) -> Result<()>
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<()>
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 morefn lookup_directory(&self, context: &mut Context, path: &Path) -> Result<()>
fn lookup_file( &self, context: &mut Context, path: &Path, flags: Flags, ) -> Result<()>
Source§fn create_file(&self, path: &Path, attributes: &Attributes) -> Result<()>
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 moreSource§fn get_attributes(&self, path: &Path, attributes: &mut Attributes) -> Result<()>
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<()>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.§fn create_symlink(
&self,
_target: &Path,
_link: &Path,
_attributes: &Attributes,
) -> Result<(), Kind>
fn create_symlink( &self, _target: &Path, _link: &Path, _attributes: &Attributes, ) -> Result<(), Kind>
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.§fn link(&self, _existing: &Path, _new: &Path) -> Result<(), Kind>
fn link(&self, _existing: &Path, _new: &Path) -> Result<(), Kind>
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].§fn read_symlink(&self, _link: &Path, _buffer: &mut [u8]) -> Result<usize, Kind>
fn read_symlink(&self, _link: &Path, _buffer: &mut [u8]) -> Result<usize, Kind>
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
impl MountOperations for FileSystem
Source§fn unmount(&self) -> Result<()>
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>
impl FileOperations for FileSystem
impl Send for FileSystem
impl Sync for FileSystem
Auto Trait Implementations§
impl !Freeze for FileSystem
impl !RefUnwindSafe for FileSystem
impl Unpin for FileSystem
impl UnsafeUnpin 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