pub struct BlockLocation {
pub index: usize,
pub header_pos: u64,
pub data_pos: u64,
pub header: BlockHeader,
}Expand description
Where a block lives in the file.
Fields§
§index: usizeZero-based index of the block in the file.
header_pos: u64Byte offset of the block magic.
data_pos: u64Byte offset of the first data byte, just past the header.
header: BlockHeaderThe decoded header.
Implementations§
Source§impl BlockLocation
impl BlockLocation
Sourcepub fn end_pos(&self) -> u64
pub fn end_pos(&self) -> u64
The offset one past the block’s allocated space, where the next block or the block index begins.
Saturating, because allocated_size comes straight from the file and
a corrupt one can be u64::MAX. Wrapping would produce an offset
inside the file and send the scanner somewhere plausible-looking;
saturating pushes it past the end, where the bounds check catches it.
Trait Implementations§
Source§impl Clone for BlockLocation
impl Clone for BlockLocation
Source§fn clone(&self) -> BlockLocation
fn clone(&self) -> BlockLocation
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 BlockLocation
impl Debug for BlockLocation
impl Eq for BlockLocation
Source§impl PartialEq for BlockLocation
impl PartialEq for BlockLocation
impl StructuralPartialEq for BlockLocation
Auto Trait Implementations§
impl Freeze for BlockLocation
impl RefUnwindSafe for BlockLocation
impl Send for BlockLocation
impl Sync for BlockLocation
impl Unpin for BlockLocation
impl UnsafeUnpin for BlockLocation
impl UnwindSafe for BlockLocation
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