pub struct MainBlock { /* private fields */ }Expand description
The main block that describes a file system node (either a file or a directory).
Contains the first block, the list of all other file blocks and the metadata.
Implementations§
Source§impl MainBlock
impl MainBlock
Sourcepub fn decode(input: Bytes) -> Result<Self, InvalidBlock>
pub fn decode(input: Bytes) -> Result<Self, InvalidBlock>
Decode main block from the provided Bytes.
Sourcepub const fn block_size(&self) -> u64
pub const fn block_size(&self) -> u64
Get block size.
Sourcepub fn first_block(&self) -> &FileBlock
pub fn first_block(&self) -> &FileBlock
Get the first block.
Sourcepub fn block_refs(&self) -> &[BlockRef]
pub fn block_refs(&self) -> &[BlockRef]
Get the references to all blocks except the first one.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MainBlock
impl RefUnwindSafe for MainBlock
impl Send for MainBlock
impl Sync for MainBlock
impl Unpin for MainBlock
impl UnwindSafe for MainBlock
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