pub struct TimestampCapabilities {
pub software_tx: bool,
pub software_rx: bool,
pub hardware_tx: bool,
pub hardware_rx: bool,
}Expand description
Timestamping capabilities of a network interface.
Fields§
§software_tx: bool§software_rx: bool§hardware_tx: bool§hardware_rx: boolImplementations§
Source§impl TimestampCapabilities
impl TimestampCapabilities
Sourcepub fn query(interface_name: &str) -> Result<Self>
pub fn query(interface_name: &str) -> Result<Self>
Query the timestamping capabilities of a network interface (Linux).
Uses a best-effort approach:
- Checks if the interface exists via
/sys/class/net/{iface}. - Checks if it has a backing hardware device via
/sys/class/net/{iface}/device/. Hardware devices with PCI backing often support hardware timestamping. - Attempts
SIOCETHTOOLwithETHTOOL_GET_TS_INFOioctl for precise capability detection. - Falls back to
software_only()if detection fails.
Software timestamping is always assumed available on Linux (kernel provides it).
Sourcepub fn software_only() -> Self
pub fn software_only() -> Self
Return default software-only capabilities (fallback).
Sourcepub fn has_hardware(&self) -> bool
pub fn has_hardware(&self) -> bool
Whether any form of hardware timestamping is available.
Sourcepub fn has_software(&self) -> bool
pub fn has_software(&self) -> bool
Whether software timestamping is available (always true on Linux/FreeBSD).
Trait Implementations§
Source§impl Clone for TimestampCapabilities
impl Clone for TimestampCapabilities
Source§fn clone(&self) -> TimestampCapabilities
fn clone(&self) -> TimestampCapabilities
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TimestampCapabilities
impl RefUnwindSafe for TimestampCapabilities
impl Send for TimestampCapabilities
impl Sync for TimestampCapabilities
impl Unpin for TimestampCapabilities
impl UnsafeUnpin for TimestampCapabilities
impl UnwindSafe for TimestampCapabilities
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