pub struct Header {
pub version: Version,
pub size: RecordSize,
pub header_type: HeaderType,
}Expand description
Header of a Crash Log record
Fields§
§version: VersionVersion ID
size: RecordSizeSize of the record
header_type: HeaderTypeOptional fields
Implementations§
Source§impl Header
impl Header
Sourcepub fn from_slice(slice: &[u8]) -> Result<Option<Self>, Error>
pub fn from_slice(slice: &[u8]) -> Result<Option<Self>, Error>
Decodes a header of a raw Crash Log record.
Sourcepub fn record_size(&self) -> usize
pub fn record_size(&self) -> usize
Returns the size of the record in bytes.
Sourcepub fn extended_record_offset(&self) -> Option<usize>
pub fn extended_record_offset(&self) -> Option<usize>
Returns the offset of the extended record in bytes if present.
Sourcepub fn product_id(&self) -> u32
pub fn product_id(&self) -> u32
Returns the product ID of the record.
Sourcepub fn product<'a, T: CollateralTree>(
&self,
cm: &'a CollateralManager<T>,
) -> Result<&'a str, Error>
Available on crate feature collateral_manager only.
pub fn product<'a, T: CollateralTree>( &self, cm: &'a CollateralManager<T>, ) -> Result<&'a str, Error>
collateral_manager only.Returns the Three-Letter Acronym associated to the product ID specified in the header.
Sourcepub fn variant<'a, T: CollateralTree>(
&self,
cm: &'a CollateralManager<T>,
) -> Option<&'a str>
Available on crate feature collateral_manager only.
pub fn variant<'a, T: CollateralTree>( &self, cm: &'a CollateralManager<T>, ) -> Option<&'a str>
collateral_manager only.Returns the product variant associated to the product ID specified in the header.
Sourcepub fn die<'a, T: CollateralTree>(
&self,
cm: &'a CollateralManager<T>,
) -> Option<&'a str>
Available on crate feature collateral_manager only.
pub fn die<'a, T: CollateralTree>( &self, cm: &'a CollateralManager<T>, ) -> Option<&'a str>
collateral_manager only.Returns the name of the die that generated the record.
This requires a CollateralManager as the die names are product-specific.
Sourcepub fn record_type(&self) -> Result<&'static str, Error>
pub fn record_type(&self) -> Result<&'static str, Error>
Returns the type of the record.
Sourcepub fn pvss<T: CollateralTree>(
&self,
cm: &CollateralManager<T>,
) -> Result<PVSS, Error>
Available on crate feature collateral_manager only.
pub fn pvss<T: CollateralTree>( &self, cm: &CollateralManager<T>, ) -> Result<PVSS, Error>
collateral_manager only.Returns the PVSS associated to this header.
Sourcepub fn header_size(&self) -> usize
pub fn header_size(&self) -> usize
Returns the size of the header in bytes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnsafeUnpin for Header
impl UnwindSafe for Header
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