Struct defmt_decoder::Table
source · pub struct Table { /* private fields */ }
Available on
unstable
only.Expand description
Internal table that holds log levels and maps format strings to indices
Implementations§
source§impl Table
impl Table
sourcepub fn parse(elf: &[u8]) -> Result<Option<Table>, Error>
pub fn parse(elf: &[u8]) -> Result<Option<Table>, Error>
Parses an ELF file and returns the decoded defmt
table.
This function returns None
if the ELF file contains no .defmt
section.
sourcepub fn parse_ignore_version(elf: &[u8]) -> Result<Option<Table>, Error>
pub fn parse_ignore_version(elf: &[u8]) -> Result<Option<Table>, Error>
Like parse
, but does not verify that the defmt version in the firmware matches the host.
CAUTION: This is meant for defmt/probe-run development only and can result in reading garbage data.
pub fn set_timestamp_entry(&mut self, timestamp: TableEntry)
pub fn indices(&self) -> impl Iterator<Item = usize> + '_
pub fn is_empty(&self) -> bool
sourcepub fn raw_symbols(&self) -> impl Iterator<Item = &str> + '_
pub fn raw_symbols(&self) -> impl Iterator<Item = &str> + '_
Iterates over the raw symbols of the table entries
pub fn get_locations(&self, elf: &[u8]) -> Result<Locations, Error>
sourcepub fn decode<'t>(
&'t self,
bytes: &[u8]
) -> Result<(Frame<'t>, usize), DecodeError>
pub fn decode<'t>( &'t self, bytes: &[u8] ) -> Result<(Frame<'t>, usize), DecodeError>
Decode the data sent by the device using the previously stored metadata.
bytes
- contains the data sent by the device that logs.
- contains the [log string index, timestamp, optional fmt string args]
pub fn new_stream_decoder(&self) -> Box<dyn StreamDecoder + '_>
pub fn encoding(&self) -> Encoding
pub fn has_timestamp(&self) -> bool
Trait Implementations§
source§impl PartialEq for Table
impl PartialEq for Table
impl Eq for Table
impl StructuralPartialEq for Table
Auto Trait Implementations§
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnwindSafe for Table
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