pub struct FatFilesystem {
start_lba: u32,
size_in_sectors: u32,
boot_sector: Box<FatBootSector>,
fat: Fat,
device: NoDebug<Arc<IdeDevice>>,
cluster_cache: ClusterCache,
}
Fields§
§start_lba: u32
§size_in_sectors: u32
§boot_sector: Box<FatBootSector>
§fat: Fat
§device: NoDebug<Arc<IdeDevice>>
§cluster_cache: ClusterCache
Implementations§
Source§impl FatFilesystem
impl FatFilesystem
fn new( start_lba: u32, size_in_sectors: u32, boot_sector: FatBootSector, device: Arc<IdeDevice>, ) -> Result<Self, FileSystemError>
pub fn volume_label(&self) -> String
pub fn fat_type(&self) -> FatType
fn first_sector_of_cluster(&self, cluster: u32) -> u32
fn read_sectors_no_cache( &self, start_sector: u32, count: u32, ) -> Result<Vec<u8>, FileSystemError>
fn write_sectors( &self, start_sector: u32, data: &[u8], ) -> Result<(), FileSystemError>
fn get_cluster(&mut self, cluster: u32) -> Option<&mut ClusterCacheEntry>
fn lock_cluster( &mut self, cluster: u32, ) -> Result<&mut ClusterCacheEntry, FileSystemError>
Sourcefn flush_cluster_dirty_range_file(
&mut self,
inode: &FileNode,
cluster_data: &[u8],
cluster_num: u32,
dirty_range: Range<usize>,
) -> Result<(), FileSystemError>
fn flush_cluster_dirty_range_file( &mut self, inode: &FileNode, cluster_data: &[u8], cluster_num: u32, dirty_range: Range<usize>, ) -> Result<(), FileSystemError>
Helper method to write the dirty parts of a cluster into disk
fn flush_cluster_dirty_range( &mut self, cluster_data: &[u8], cluster_num: u32, dirty_range: Range<usize>, ) -> Result<(), FileSystemError>
fn release_cluster( &mut self, inode: &FileNode, cluster: u32, ) -> Result<(), FileSystemError>
Sourcefn flush_cluster(
&mut self,
inode: &FileNode,
cluster: u32,
) -> Result<(), FileSystemError>
fn flush_cluster( &mut self, inode: &FileNode, cluster: u32, ) -> Result<(), FileSystemError>
Same as release_cluster
, but doesn’t release it, i.e. the cluster will
still be used, but the dirty
flag is removed
fn flush_fat(&mut self) -> Result<(), FileSystemError>
fn open_root_dir(&self) -> Result<Directory, FileSystemError>
fn open_root_dir_inode(&self) -> Result<DirectoryNode, FileSystemError>
pub fn open_dir_inode( &self, inode: &DirectoryNode, ) -> Result<DirectoryIterator<'_>, FileSystemError>
fn read_write_file( &mut self, inode: &FileNode, position: u32, buf: FileAccessBuffer<'_>, access_helper: &mut AccessHelper, ) -> Result<u64, FileSystemError>
fn update_directory_entry( &mut self, inode: &BaseNode, update: impl FnMut(&mut DirectoryEntryNormal), ) -> Result<(), FileSystemError>
fn add_directory_entry( &mut self, parent_inode: &DirectoryNode, name: &str, attributes: FileAttributes, ) -> Result<Node, FileSystemError>
fn set_file_size( &mut self, inode: &mut FileNode, size: u64, ) -> Result<(), FileSystemError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FatFilesystem
impl !RefUnwindSafe for FatFilesystem
impl Send for FatFilesystem
impl Sync for FatFilesystem
impl Unpin for FatFilesystem
impl !UnwindSafe for FatFilesystem
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.