Struct defmt_decoder::Table[][src]

pub struct Table { /* fields omitted */ }
This is supported on unstable only.
Expand description

Internal table that holds log levels and maps format strings to indices

Implementations

impl Table[src]

pub fn new(entries: BTreeMap<usize, TableEntry>) -> Self[src]

NOTE caller must verify that defmt symbols are compatible with this version of the decoder crate using the check_version function

pub fn parse(elf: &[u8]) -> Result<Option<Table>, Error>[src]

Parses an ELF file and returns the decoded defmt table.

This function returns None if the ELF file contains no .defmt section.

pub fn parse_ignore_version(elf: &[u8]) -> Result<Option<Table>, Error>[src]

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)[src]

pub fn indices(&self) -> impl Iterator<Item = usize> + '_[src]

pub fn is_empty(&self) -> bool[src]

pub fn raw_symbols(&self) -> impl Iterator<Item = &str> + '_[src]

Iterates over the raw symbols of the table entries

pub fn get_locations(&self, elf: &[u8]) -> Result<Locations, Error>[src]

pub fn decode<'t>(
    &'t self,
    bytes: &[u8]
) -> Result<(Frame<'t>, usize), DecodeError>
[src]

decode the data sent by the device using the previosuly stored metadata

  • bytes: contains the data sent by the device that logs. contains the [log string index, timestamp, optional fmt string args]

Trait Implementations

impl Debug for Table[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.