Struct pcap_parser::pcapng::PcapNGOption
source · pub struct PcapNGOption<'a> {
pub code: OptionCode,
pub len: u16,
pub value: Cow<'a, [u8]>,
}
Fields§
§code: OptionCode
§len: u16
§value: Cow<'a, [u8]>
Implementations§
source§impl<'a> PcapNGOption<'a>
impl<'a> PcapNGOption<'a>
sourcepub fn value(&self) -> &[u8] ⓘ
pub fn value(&self) -> &[u8] ⓘ
Return a reference to the option value, as raw bytes (not related to the len
field)
sourcepub fn as_bytes(&self) -> Option<&[u8]>
pub fn as_bytes(&self) -> Option<&[u8]>
Return a reference to the option value, using the len
field to limit it, or None if length is invalid
sourcepub fn as_i32_le(&self) -> Option<i32>
pub fn as_i32_le(&self) -> Option<i32>
Return the option value interpreted as i32, or None
Option data length and declared must be exactly 4 bytes
sourcepub fn as_u32_le(&self) -> Option<u32>
pub fn as_u32_le(&self) -> Option<u32>
Return the option value interpreted as u32, or None
Option data length and declared must be exactly 4 bytes
Trait Implementations§
source§impl<'a> Debug for PcapNGOption<'a>
impl<'a> Debug for PcapNGOption<'a>
source§impl<'a> ToVec for PcapNGOption<'a>
Available on crate feature serialize
only.
impl<'a> ToVec for PcapNGOption<'a>
Available on crate feature
serialize
only.Auto Trait Implementations§
impl<'a> RefUnwindSafe for PcapNGOption<'a>
impl<'a> Send for PcapNGOption<'a>
impl<'a> Sync for PcapNGOption<'a>
impl<'a> Unpin for PcapNGOption<'a>
impl<'a> UnwindSafe for PcapNGOption<'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