pub struct Translator { /* private fields */ }Expand description
Stateful translator: maps a stream of Packets to TraceEvents,
reassembling port-0 bytes into whole log lines.
Implementations§
Source§impl Translator
impl Translator
pub fn new(vars: VariableMap) -> Translator
Sourcepub fn translate(&mut self, packet: &Packet) -> Vec<TraceEvent>
pub fn translate(&mut self, packet: &Packet) -> Vec<TraceEvent>
Translate one packet into zero or more events.
Sourcepub fn flush(&mut self) -> Vec<TraceEvent>
pub fn flush(&mut self) -> Vec<TraceEvent>
Flush any buffered partial log line (e.g. on shutdown).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Translator
impl RefUnwindSafe for Translator
impl Send for Translator
impl Sync for Translator
impl Unpin for Translator
impl UnsafeUnpin for Translator
impl UnwindSafe for Translator
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