pub struct Record {
pub header: Header,
pub data: Vec<u8>,
pub context: Context,
}Expand description
A single Crash Log record
Fields§
§header: HeaderHeader of the record
data: Vec<u8>Raw content of the record
context: ContextAdditional information provided to the record
Implementations§
Source§impl Record
impl Record
Sourcepub fn decode_with_csv(
&self,
layout: &[u8],
offset: usize,
) -> Result<Node, Error>
pub fn decode_with_csv( &self, layout: &[u8], offset: usize, ) -> Result<Node, Error>
Decodes a section of the Record located at the given offset into a Node tree using an
arbitrary decode definition (layout).
The decode definition must be CSV-encoded, use semi-colons as delimiters, and contain the following columns:
name: Dot-separated path to the field in the decode output (example:aaa.bbb.ccc). The path can be relative to the previous entry (example:..bar.baz).offset: offset of the field in the record in bits.size: size of the field in bits.description: description of the field.
§Examples
use intel_crashlog::prelude::*;
let record = Record {
header: Header::default(),
data: vec![0x42],
..Record::default()
};
let csv = "name;offset;size;description;bitfield
foo.bar;0;8;;0";
let root = record.decode_with_csv(csv.as_bytes(), 0).unwrap();
let field = root.get_by_path("foo.bar").unwrap();
assert_eq!(field.kind, NodeType::Field { value: 0x42 });Sourcepub fn decode_without_cm(&self) -> Node
pub fn decode_without_cm(&self) -> Node
Sourcepub fn decode_with_decode_def<T: CollateralTree>(
&self,
cm: &mut CollateralManager<T>,
decode_def: &str,
offset: usize,
) -> Result<Node, Error>
Available on crate feature collateral_manager only.
pub fn decode_with_decode_def<T: CollateralTree>( &self, cm: &mut CollateralManager<T>, decode_def: &str, offset: usize, ) -> Result<Node, Error>
collateral_manager only.Sourcepub fn decode<T: CollateralTree>(&self, cm: &mut CollateralManager<T>) -> Node
Available on crate feature collateral_manager only.
pub fn decode<T: CollateralTree>(&self, cm: &mut CollateralManager<T>) -> Node
collateral_manager only.Trait Implementations§
Auto Trait Implementations§
impl Freeze for Record
impl RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl UnsafeUnpin for Record
impl UnwindSafe for Record
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