pub enum FieldValue<'data> {
}Expand description
Possible field value types (maps to Arrow types).
FieldValue supports zero-copy parsing where possible:
StrandBytesreference packet data directlyOwnedStringandOwnedBytesare used when values must be constructed
The lifetime parameter 'data ties the value to the packet/buffer data.
Variants§
UInt8(u8)
Unsigned 8-bit integer
UInt16(u16)
Unsigned 16-bit integer
UInt32(u32)
Unsigned 32-bit integer
UInt64(u64)
Unsigned 64-bit integer
Int64(i64)
Signed 64-bit integer
Bool(bool)
Boolean value
IpAddr(IpAddr)
IP address (v4 or v6)
MacAddr([u8; 6])
MAC address (6 bytes)
Str(&'data str)
Zero-copy string reference into packet data. Use for strings that exist verbatim in the packet (e.g., TLS SNI, SSH version).
Bytes(&'data [u8])
Zero-copy byte slice reference into packet data. Use for payload or binary data that exists verbatim in the packet.
OwnedString(CompactString)
Owned string for constructed values (DNS names, joined lists, enum names). Uses CompactString for small-string optimization (inline up to 24 bytes).
OwnedBytes(Vec<u8>)
Owned bytes for constructed/decoded data.
List(Vec<FieldValue<'data>>)
List of values (for multi-valued fields like DNS answers). All elements should be of the same type. Note: Uses Vec because FieldValue is recursive (SmallVec inline storage causes infinite size).
Null
Null/missing value
Implementations§
Source§impl<'data> FieldValue<'data>
impl<'data> FieldValue<'data>
Sourcepub fn format_mac(mac: &[u8; 6]) -> String
pub fn format_mac(mac: &[u8; 6]) -> String
Format a MAC address as a string.
Sourcepub fn as_list(&self) -> Option<&[FieldValue<'data>]>
pub fn as_list(&self) -> Option<&[FieldValue<'data>]>
Try to get as list reference.
Sourcepub fn list_len(&self) -> Option<usize>
pub fn list_len(&self) -> Option<usize>
Get the number of elements if this is a list, or None otherwise.
Sourcepub fn to_owned(&self) -> FieldValue<'static>
pub fn to_owned(&self) -> FieldValue<'static>
Convert to an owned version (for caching). Copies borrowed data into owned variants.
Trait Implementations§
Source§impl<'data> Clone for FieldValue<'data>
impl<'data> Clone for FieldValue<'data>
Source§fn clone(&self) -> FieldValue<'data>
fn clone(&self) -> FieldValue<'data>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'data> Debug for FieldValue<'data>
impl<'data> Debug for FieldValue<'data>
Source§impl<'data> Display for FieldValue<'data>
impl<'data> Display for FieldValue<'data>
Source§impl<'a, 'b> PartialEq<FieldValue<'b>> for FieldValue<'a>
impl<'a, 'b> PartialEq<FieldValue<'b>> for FieldValue<'a>
Auto Trait Implementations§
impl<'data> Freeze for FieldValue<'data>
impl<'data> RefUnwindSafe for FieldValue<'data>
impl<'data> Send for FieldValue<'data>
impl<'data> Sync for FieldValue<'data>
impl<'data> Unpin for FieldValue<'data>
impl<'data> UnwindSafe for FieldValue<'data>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more