pub struct ValidatedPacket {
pub packet: DataPacket,
pub is_valid: bool,
}Expand description
带校验结果的数据包
Fields§
§packet: DataPacket数据包
is_valid: bool校验是否通过
Implementations§
Source§impl ValidatedPacket
impl ValidatedPacket
Sourcepub fn new(packet: DataPacket, is_valid: bool) -> Self
pub fn new(packet: DataPacket, is_valid: bool) -> Self
创建带校验结果的数据包
Sourcepub fn is_invalid(&self) -> bool
pub fn is_invalid(&self) -> bool
检查是否无效
Sourcepub fn get_timestamp_ns(&self) -> u64
pub fn get_timestamp_ns(&self) -> u64
获取时间戳(纳秒)- 委托给内部数据包
Sourcepub fn packet_length(&self) -> usize
pub fn packet_length(&self) -> usize
获取数据包长度 - 委托给内部数据包
Sourcepub fn capture_time(&self) -> DateTime<Utc>
pub fn capture_time(&self) -> DateTime<Utc>
获取捕获时间 - 委托给内部数据包
Sourcepub fn total_size(&self) -> usize
pub fn total_size(&self) -> usize
获取总大小 - 委托给内部数据包
Trait Implementations§
Source§impl Clone for ValidatedPacket
impl Clone for ValidatedPacket
Source§fn clone(&self) -> ValidatedPacket
fn clone(&self) -> ValidatedPacket
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 moreSource§impl Debug for ValidatedPacket
impl Debug for ValidatedPacket
Source§impl<'de> Deserialize<'de> for ValidatedPacket
impl<'de> Deserialize<'de> for ValidatedPacket
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ValidatedPacket
impl RefUnwindSafe for ValidatedPacket
impl Send for ValidatedPacket
impl Sync for ValidatedPacket
impl Unpin for ValidatedPacket
impl UnwindSafe for ValidatedPacket
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