pub struct SerialDecoder<'a> { /* private fields */ }
Expand description
Decoder for logs sent through a SerialLogger in libpostform. Implements rcobs decoding and detection of start/end of message.
Implementations§
Source§impl<'a> SerialDecoder<'a>
impl<'a> SerialDecoder<'a>
Sourcepub fn new(elf_metadata: &'a ElfMetadata) -> Self
pub fn new(elf_metadata: &'a ElfMetadata) -> Self
Creates a new SerialDecoder instance.
Sourcepub fn feed_and_do<T>(&mut self, data: &[u8], action: T)
pub fn feed_and_do<T>(&mut self, data: &[u8], action: T)
Feeds data to the decoder and accepts an action to trigger every time a message is decoded. This action can then print the logs to stdout or do whatever the user prefers.
Auto Trait Implementations§
impl<'a> Freeze for SerialDecoder<'a>
impl<'a> RefUnwindSafe for SerialDecoder<'a>
impl<'a> Send for SerialDecoder<'a>
impl<'a> Sync for SerialDecoder<'a>
impl<'a> Unpin for SerialDecoder<'a>
impl<'a> UnwindSafe for SerialDecoder<'a>
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