pub trait Tracked {
// Required methods
fn new(first_pkt: &L4Pdu) -> Self;
fn update(&mut self, pdu: &L4Pdu, reassembled: bool);
fn stream_protocols() -> Vec<&'static str>;
fn clear(&mut self);
}
Expand description
Trait implemented by datatypes that require inline tracking. This is typically required for subscribable types that require calculating metrics throughout a connection, e.g. QoS metrics.
Required Methods§
Sourcefn new(first_pkt: &L4Pdu) -> Self
fn new(first_pkt: &L4Pdu) -> Self
Initialize internal data; called once per connection.
Note first_pkt
will also be delivered to update
.
Sourcefn update(&mut self, pdu: &L4Pdu, reassembled: bool)
fn update(&mut self, pdu: &L4Pdu, reassembled: bool)
New packet in connection received (or reassembled, if reassembled=true)
Note this may be invoked both pre- and post-reassembly; types
should check reassembled
to avoid double-counting.
Sourcefn stream_protocols() -> Vec<&'static str>
fn stream_protocols() -> Vec<&'static str>
The stream protocols (lower-case) required for this datatype.
See IMPLEMENTED_PROTOCOLS
in retina_core for list of supported protocols.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.