pub struct OwnedParseResult {
pub fields: HashMap<&'static str, OwnedFieldValue>,
pub error: Option<String>,
pub encap_depth: u8,
pub tunnel_type: TunnelType,
pub tunnel_id: Option<u64>,
}Expand description
Owned parse result for a single protocol layer.
This is an owned version of ParseResult<'a> that can be stored in the cache.
All field values are owned (no borrowed references).
Fields§
§fields: HashMap<&'static str, OwnedFieldValue>Extracted field values, keyed by field name. Field names are always static strings from protocol definitions.
error: Option<String>Parse error if partial parsing occurred.
encap_depth: u8Encapsulation depth when this protocol was parsed (0 = outer layer).
tunnel_type: TunnelTypeType of the innermost enclosing tunnel (if inside a tunnel).
tunnel_id: Option<u64>Identifier of the innermost enclosing tunnel (VNI, GRE key, TEID, etc.).
Implementations§
Source§impl OwnedParseResult
impl OwnedParseResult
Sourcepub fn from_borrowed(
fields: &SmallVec<[(&'static str, FieldValue<'_>); 16]>,
error: Option<&String>,
) -> Self
pub fn from_borrowed( fields: &SmallVec<[(&'static str, FieldValue<'_>); 16]>, error: Option<&String>, ) -> Self
Create a new owned parse result from a borrowed one. Converts all borrowed field values to owned values.
Sourcepub fn from_parse_result(result: &ParseResult<'_>) -> Self
pub fn from_parse_result(result: &ParseResult<'_>) -> Self
Create a new owned parse result from a ParseResult with encap context.
Sourcepub fn get(&self, name: &str) -> Option<&OwnedFieldValue>
pub fn get(&self, name: &str) -> Option<&OwnedFieldValue>
Get a field value by name.
Trait Implementations§
Source§impl Clone for OwnedParseResult
impl Clone for OwnedParseResult
Source§fn clone(&self) -> OwnedParseResult
fn clone(&self) -> OwnedParseResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OwnedParseResult
impl RefUnwindSafe for OwnedParseResult
impl Send for OwnedParseResult
impl Sync for OwnedParseResult
impl Unpin for OwnedParseResult
impl UnwindSafe for OwnedParseResult
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