[−][src]Enum spirit_tokio::net::MaybeDuration
Configuration that can be unset, explicitly turned off or set to a duration.
Some network configuration options can be either turned off or set to a certain duration. We add the ability to leave them on the OS default (which is done if the field is not present in the configuration).
Panics
If using on your own and using Serialize
, make sure that you use
#[serde(skip_serializing_if = "MaybeDuration::is_unset")]
, or you'll get a panic during
serialization.
Variants
Leaves the option at the OS default.
Signified by not being present in the configuration.
Turns the option off.
Deserialized from false
.
Duration(Duration)
Turns the option on with given duration.
Deserialized from human-readable duration specification, eg. 100ms
or 30s
.
Trait Implementations
impl Clone for MaybeDuration
[src]
fn clone(&self) -> MaybeDuration
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for MaybeDuration
[src]
impl Debug for MaybeDuration
[src]
impl Default for MaybeDuration
[src]
impl<'de> Deserialize<'de> for MaybeDuration
[src]
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
[src]
impl Eq for MaybeDuration
[src]
impl Hash for MaybeDuration
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for MaybeDuration
[src]
fn cmp(&self, other: &MaybeDuration) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<MaybeDuration> for MaybeDuration
[src]
fn eq(&self, other: &MaybeDuration) -> bool
[src]
fn ne(&self, other: &MaybeDuration) -> bool
[src]
impl PartialOrd<MaybeDuration> for MaybeDuration
[src]
fn partial_cmp(&self, other: &MaybeDuration) -> Option<Ordering>
[src]
fn lt(&self, other: &MaybeDuration) -> bool
[src]
fn le(&self, other: &MaybeDuration) -> bool
[src]
fn gt(&self, other: &MaybeDuration) -> bool
[src]
fn ge(&self, other: &MaybeDuration) -> bool
[src]
impl Serialize for MaybeDuration
[src]
impl StructuralEq for MaybeDuration
[src]
impl StructuralPartialEq for MaybeDuration
[src]
Auto Trait Implementations
impl RefUnwindSafe for MaybeDuration
impl Send for MaybeDuration
impl Sync for MaybeDuration
impl Unpin for MaybeDuration
impl UnwindSafe for MaybeDuration
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoResult<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,