pub struct DefaultBlockTable {
pub physical: SmallVec<[u32; 8]>,
pub logical_to_physical: SmallVec<[u32; 8]>,
pub seq_len: usize,
}Expand description
Default implementation of block table
Fields§
§physical: SmallVec<[u32; 8]>Physical block usage bitmap
logical_to_physical: SmallVec<[u32; 8]>Logical to physical block mapping
seq_len: usizeSequence length
Implementations§
Source§impl DefaultBlockTable
impl DefaultBlockTable
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create with capacity
Sourcepub fn unmap_block(&mut self, logical_id: u32) -> Option<u32>
pub fn unmap_block(&mut self, logical_id: u32) -> Option<u32>
Remove mapping for logical block
Sourcepub fn get_physical(&self, logical_id: u32) -> Option<u32>
pub fn get_physical(&self, logical_id: u32) -> Option<u32>
Get physical block ID for logical block
Sourcepub fn is_physical_used(&self, physical_id: u32) -> bool
pub fn is_physical_used(&self, physical_id: u32) -> bool
Check if physical block is used
Sourcepub fn num_logical_blocks(&self) -> usize
pub fn num_logical_blocks(&self) -> usize
Get number of logical blocks
Sourcepub fn num_physical_blocks(&self) -> usize
pub fn num_physical_blocks(&self) -> usize
Get number of physical blocks allocated
Sourcepub fn num_used_blocks(&self) -> usize
pub fn num_used_blocks(&self) -> usize
Get number of used physical blocks
Sourcepub fn used_physical_blocks(&self) -> Vec<u32>
pub fn used_physical_blocks(&self) -> Vec<u32>
Get all used physical block IDs
Trait Implementations§
Source§impl Clone for DefaultBlockTable
impl Clone for DefaultBlockTable
Source§fn clone(&self) -> DefaultBlockTable
fn clone(&self) -> DefaultBlockTable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DefaultBlockTable
impl Debug for DefaultBlockTable
Source§impl Default for DefaultBlockTable
impl Default for DefaultBlockTable
Source§fn default() -> DefaultBlockTable
fn default() -> DefaultBlockTable
Returns the “default value” for a type. Read more
Source§impl From<BlockTable> for DefaultBlockTable
impl From<BlockTable> for DefaultBlockTable
Source§fn from(table: BlockTable) -> Self
fn from(table: BlockTable) -> Self
Converts to this type from the input type.
Source§impl From<DefaultBlockTable> for BlockTable
impl From<DefaultBlockTable> for BlockTable
Source§fn from(table: DefaultBlockTable) -> Self
fn from(table: DefaultBlockTable) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for DefaultBlockTable
impl RefUnwindSafe for DefaultBlockTable
impl Send for DefaultBlockTable
impl Sync for DefaultBlockTable
impl Unpin for DefaultBlockTable
impl UnsafeUnpin for DefaultBlockTable
impl UnwindSafe for DefaultBlockTable
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