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]