pub struct Fat32 { /* private fields */ }Expand description
FAT32 allocation-table descriptor.
Implementations§
Source§impl Fat32
impl Fat32
Sourcepub fn new(start: usize, size: usize, count: usize, max_cluster: u32) -> Self
pub fn new(start: usize, size: usize, count: usize, max_cluster: u32) -> Self
Creates a FAT32 table descriptor.
Sourcepub fn max_cluster(&self) -> u32
pub fn max_cluster(&self) -> u32
Get the maximum cluster number.
Sourcepub fn next_cluster<T: Read + Seek>(
&self,
reader: &mut T,
cluster: usize,
) -> Result<Option<u32>>
pub fn next_cluster<T: Read + Seek>( &self, reader: &mut T, cluster: usize, ) -> Result<Option<u32>>
Returns the next cluster in a chain, or None at end-of-chain.
Sourcepub fn write_clus<T: Read + Write + Seek>(
&self,
io: &mut T,
cluster: usize,
value: u32,
) -> Result<()>
pub fn write_clus<T: Read + Write + Seek>( &self, io: &mut T, cluster: usize, value: u32, ) -> Result<()>
Write a cluster entry to all FAT table copies
Sourcepub fn allocate_cluster<T: Read + Write + Seek>(
&self,
rw: &mut T,
hint: u32,
) -> Result<u32>
pub fn allocate_cluster<T: Read + Write + Seek>( &self, rw: &mut T, hint: u32, ) -> Result<u32>
Allocate a single cluster, returns the allocated cluster number.
Searches starting from hint for a free cluster.
Sourcepub fn allocate_chain<T: Read + Write + Seek>(
&self,
rw: &mut T,
count: usize,
hint: u32,
) -> Result<u32>
pub fn allocate_chain<T: Read + Write + Seek>( &self, rw: &mut T, count: usize, hint: u32, ) -> Result<u32>
Allocate a chain of clusters, linking them together. Returns the first cluster of the allocated chain.
Sourcepub fn free_chain<T: Read + Write + Seek>(
&self,
rw: &mut T,
start: u32,
) -> Result<u32>
pub fn free_chain<T: Read + Write + Seek>( &self, rw: &mut T, start: u32, ) -> Result<u32>
Free a cluster chain starting at start, returns count of freed clusters.
Sourcepub fn truncate_chain<T: Read + Write + Seek>(
&self,
rw: &mut T,
cluster: u32,
) -> Result<u32>
pub fn truncate_chain<T: Read + Write + Seek>( &self, rw: &mut T, cluster: u32, ) -> Result<u32>
Truncate a cluster chain after the specified cluster.
The specified cluster becomes the end of chain (marked with end-of-chain marker). All clusters following it are freed.
Returns the number of clusters freed.
Auto Trait Implementations§
impl Freeze for Fat32
impl RefUnwindSafe for Fat32
impl Send for Fat32
impl Sync for Fat32
impl Unpin for Fat32
impl UnsafeUnpin for Fat32
impl UnwindSafe for Fat32
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