pub struct ObjectHeader {
pub version: u8,
pub messages: Vec<HdfMessage>,
pub reference_count: u32,
pub modification_time: Option<u32>,
}Expand description
Parsed object header with all its messages.
Fields§
§version: u8Object header format version (1 or 2).
messages: Vec<HdfMessage>All parsed header messages, collected from every chunk.
reference_count: u32Object reference count.
modification_time: Option<u32>Modification time in seconds since the UNIX epoch (v2 only, when the “times stored” flag is set).
Implementations§
Source§impl ObjectHeader
impl ObjectHeader
Sourcepub fn parse_at(
data: &[u8],
address: u64,
offset_size: u8,
length_size: u8,
) -> Result<Self>
pub fn parse_at( data: &[u8], address: u64, offset_size: u8, length_size: u8, ) -> Result<Self>
Parse an object header at the given absolute file address.
data is the entire file mapped into memory, address is the byte
offset where the object header starts, and offset_size / length_size
come from the superblock.
Sourcepub fn parse_at_storage(
storage: &dyn Storage,
address: u64,
offset_size: u8,
length_size: u8,
) -> Result<Self>
pub fn parse_at_storage( storage: &dyn Storage, address: u64, offset_size: u8, length_size: u8, ) -> Result<Self>
Parse an object header from random-access storage.
Resolve shared messages by following references to other object headers.
For SharedInOhdr, the referenced object header is parsed and the
matching message type is extracted. SharedInSohm requires the
storage-backed resolver because the SOHM table lives in file metadata.
Resolve shared messages by following references via random-access storage.
Trait Implementations§
Source§impl Clone for ObjectHeader
impl Clone for ObjectHeader
Source§fn clone(&self) -> ObjectHeader
fn clone(&self) -> ObjectHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ObjectHeader
impl RefUnwindSafe for ObjectHeader
impl Send for ObjectHeader
impl Sync for ObjectHeader
impl Unpin for ObjectHeader
impl UnsafeUnpin for ObjectHeader
impl UnwindSafe for ObjectHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more