Enum pcap::TimestampType

source ·
#[repr(i32)]
pub enum TimestampType { Host = 0, HostLowPrec = 1, HostHighPrec = 2, Adapter = 3, AdapterUnsynced = 4, }
Expand description

Timestamp types

Not all systems and interfaces will necessarily support all of these.

Note that time stamps synchronized with the system clock can go backwards, as the system clock can go backwards. If a clock is not in sync with the system clock, that could be because the system clock isn’t keeping accurate time, because the other clock isn’t keeping accurate time, or both.

Note that host-provided time stamps generally correspond to the time when the time-stamping code sees the packet; this could be some unknown amount of time after the first or last bit of the packet is received by the network adapter, due to batching of interrupts for packet arrival, queueing delays, etc..

Variants§

§

Host = 0

Timestamps are provided by the host machine, rather than by the capture device.

The characteristics of the timestamp are unknown.

§

HostLowPrec = 1

A timestamp provided by the host machine that is low precision but relatively cheap to fetch.

This is normally done using the system clock, so it’s normally synchornized with times you’d fetch from system calls.

§

HostHighPrec = 2

A timestamp provided by the host machine that is high precision. It might be more expensive to fetch.

The timestamp might or might not be synchronized with the system clock, and might have problems with time stamps for packets received on different CPUs, depending on the platform.

§

Adapter = 3

The timestamp is a high-precision time stamp supplied by the capture device.

The timestamp is synchronized with the system clock.

§

AdapterUnsynced = 4

The timestamp is a high-precision time stamp supplied by the capture device.

The timestamp is not synchronized with the system clock.

Trait Implementations§

source§

impl Clone for TimestampType

source§

fn clone(&self) -> TimestampType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TimestampType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for TimestampType

source§

fn eq(&self, other: &TimestampType) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for TimestampType

source§

impl Eq for TimestampType

source§

impl StructuralEq for TimestampType

source§

impl StructuralPartialEq for TimestampType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.