pub struct RttMillis(/* private fields */);Expand description
Deliberately not Default: zero is a genuine measurement (a sub-millisecond round trip), so a defaulted value would forge one.
An unmeasured RTT is an Option<RttMillis> instead.
Implementations§
Source§impl RttMillis
impl RttMillis
pub const fn new(millis: u64) -> RttMillis
pub const fn measured_between( sent: InstantMillis, arrived: InstantMillis, ) -> RttMillis
pub const fn millis(self) -> u64
Trait Implementations§
impl Copy for RttMillis
impl Eq for RttMillis
Source§impl From<RttMillis> for ChannelRtt
impl From<RttMillis> for ChannelRtt
Source§fn from(rtt: RttMillis) -> ChannelRtt
fn from(rtt: RttMillis) -> ChannelRtt
Converts to this type from the input type.
Source§impl Ord for RttMillis
impl Ord for RttMillis
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for RttMillis
impl PartialOrd for RttMillis
impl StructuralPartialEq for RttMillis
Auto Trait Implementations§
impl Freeze for RttMillis
impl RefUnwindSafe for RttMillis
impl Send for RttMillis
impl Sync for RttMillis
impl Unpin for RttMillis
impl UnsafeUnpin for RttMillis
impl UnwindSafe for RttMillis
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