[][src]Struct mqttest::OptMsDuration

pub struct OptMsDuration(pub Option<Duration>);

Convenience type to save on typing an Option<Duration>.

fn fmt_opt_duration(od: impl Into<OptMsDuration>) -> String {
    format!("{:?}", od.into().0)
}
assert_eq!("None", &fmt_opt_duration(None));
assert_eq!("Some(0ns)", &fmt_opt_duration(Some(Duration::from_millis(0))));
assert_eq!("Some(1s)", &fmt_opt_duration(Duration::from_secs(1)));
assert_eq!("Some(2s)", &fmt_opt_duration(2000));

Trait Implementations

impl From<Duration> for OptMsDuration[src]

impl From<Option<Duration>> for OptMsDuration[src]

impl From<u64> for OptMsDuration[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,