pub struct CachedFat<'a> { /* private fields */ }Expand description
Cached FAT operations that work with any FAT type.
Implementations§
Source§impl<'a> CachedFat<'a>
impl<'a> CachedFat<'a>
Sourcepub fn new(cache: &'a mut FatSectorCache, fat: &Fat) -> Self
pub fn new(cache: &'a mut FatSectorCache, fat: &Fat) -> Self
Create a new cached FAT wrapper.
Sourcepub fn next_cluster<T: Read + Seek>(
&mut self,
reader: &mut T,
cluster: usize,
) -> Result<Option<u32>>
pub fn next_cluster<T: Read + Seek>( &mut self, reader: &mut T, cluster: usize, ) -> Result<Option<u32>>
Get the next cluster in a chain using the cache.
Sourcepub fn read_chain<T: Read + Seek>(
&mut self,
reader: &mut T,
start_cluster: u32,
) -> Result<Vec<u32>>
pub fn read_chain<T: Read + Seek>( &mut self, reader: &mut T, start_cluster: u32, ) -> Result<Vec<u32>>
Read the entire cluster chain starting from a cluster.
This is efficient because it uses the cache to avoid repeated seeks.
On a chain longer than max_cluster clusters (only possible if the
FAT is corrupt and contains a loop), returns
Error::ClusterLoop rather than silently returning a
partial chain.
Auto Trait Implementations§
impl<'a> !UnwindSafe for CachedFat<'a>
impl<'a> Freeze for CachedFat<'a>
impl<'a> RefUnwindSafe for CachedFat<'a>
impl<'a> Send for CachedFat<'a>
impl<'a> Sync for CachedFat<'a>
impl<'a> Unpin for CachedFat<'a>
impl<'a> UnsafeUnpin for CachedFat<'a>
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