pub struct IdleTimeout(/* private fields */);
Expand description
Maximum duration of inactivity to accept before timing out the connection.
This wraps an underlying VarInt
, representing the duration in milliseconds. Values can be
constructed by converting directly from VarInt
, or using TryFrom<Duration>
.
// A `VarInt`-encoded value in milliseconds
let timeout = IdleTimeout::from(VarInt::from_u32(10_000));
// Try to convert a `Duration` into a `VarInt`-encoded timeout
let timeout = IdleTimeout::try_from(Duration::from_secs(10))?;
Trait Implementations§
Source§impl Clone for IdleTimeout
impl Clone for IdleTimeout
Source§fn clone(&self) -> IdleTimeout
fn clone(&self) -> IdleTimeout
Returns a copy 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 IdleTimeout
impl Debug for IdleTimeout
Source§impl Default for IdleTimeout
impl Default for IdleTimeout
Source§fn default() -> IdleTimeout
fn default() -> IdleTimeout
Returns the “default value” for a type. Read more
Source§impl From<VarInt> for IdleTimeout
impl From<VarInt> for IdleTimeout
Source§impl Hash for IdleTimeout
impl Hash for IdleTimeout
Source§impl Ord for IdleTimeout
impl Ord for IdleTimeout
Source§fn cmp(&self, other: &IdleTimeout) -> Ordering
fn cmp(&self, other: &IdleTimeout) -> Ordering
1.21.0 · 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 PartialEq for IdleTimeout
impl PartialEq for IdleTimeout
Source§impl PartialOrd for IdleTimeout
impl PartialOrd for IdleTimeout
Source§impl TryFrom<Duration> for IdleTimeout
impl TryFrom<Duration> for IdleTimeout
impl Copy for IdleTimeout
impl Eq for IdleTimeout
impl StructuralPartialEq for IdleTimeout
Auto Trait Implementations§
impl Freeze for IdleTimeout
impl RefUnwindSafe for IdleTimeout
impl Send for IdleTimeout
impl Sync for IdleTimeout
impl Unpin for IdleTimeout
impl UnwindSafe for IdleTimeout
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)