pub struct MdbShard {
pub header: MdbShardHeader,
pub footer: MdbShardFooter,
}Expand description
A parsed shard: header + footer, with helpers to seek into the byte buffer and reconstruct a file.
Fields§
§header: MdbShardHeaderImplementations§
Source§impl MdbShard
impl MdbShard
Sourcepub fn parse(bytes: &[u8]) -> Result<Self>
pub fn parse(bytes: &[u8]) -> Result<Self>
Parse the header and footer from a complete shard byte buffer.
Sourcepub fn file_info(
&self,
bytes: &[u8],
file_hash: &MerkleHash,
) -> Result<Option<MdbFileInfo>>
pub fn file_info( &self, bytes: &[u8], file_hash: &MerkleHash, ) -> Result<Option<MdbFileInfo>>
Read the MDBFileInfo (header + segments) for file_hash, seeking the
file-lookup table then walking the candidate indices exactly like
MDBShardInfo::get_file_reconstruction_info.
Sourcepub fn all_cas_blocks(&self, bytes: &[u8]) -> Result<Vec<MdbCasInfo>>
pub fn all_cas_blocks(&self, bytes: &[u8]) -> Result<Vec<MdbCasInfo>>
Read every xorb’s chunk list (used to verify/inspect a shard).
Auto Trait Implementations§
impl Freeze for MdbShard
impl RefUnwindSafe for MdbShard
impl Send for MdbShard
impl Sync for MdbShard
impl Unpin for MdbShard
impl UnsafeUnpin for MdbShard
impl UnwindSafe for MdbShard
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