[−][src]Struct rubble::time::Duration
A duration with microsecond resolution.
This can represent a maximum duration of about 1 hour. Overflows will result in a panic, but shouldn't happen since the BLE stack doesn't deal with durations that large.
Methods
impl Duration
[src]
pub const T_IFS: Self
[src]
The duration of the interframe spacing between BLE packets.
pub fn from_micros(micros: u32) -> Self
[src]
Creates a Duration
from a number of microseconds.
pub fn from_millis(millis: u16) -> Self
[src]
Creates a Duration
representing the given number of milliseconds.
pub fn from_secs(secs: u16) -> Self
[src]
Creates a Duration
representing a number of seconds.
pub fn whole_secs(&self) -> u32
[src]
Returns the number of whole seconds that fit in self
.
pub fn whole_millis(&self) -> u32
[src]
Returns the number of whole milliseconds that fit in self
.
pub fn as_micros(&self) -> u32
[src]
Returns the number of microseconds represented by self
.
pub fn subsec_micros(&self) -> u32
[src]
Returns the fractional part of microseconds in self
.
Trait Implementations
impl Copy for Duration
[src]
impl Display for Duration
[src]
impl Debug for Duration
[src]
impl PartialEq<Duration> for Duration
[src]
impl Eq for Duration
[src]
impl Ord for Duration
[src]
fn cmp(&self, other: &Duration) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl PartialOrd<Duration> for Duration
[src]
fn partial_cmp(&self, other: &Duration) -> Option<Ordering>
[src]
fn lt(&self, other: &Duration) -> bool
[src]
fn le(&self, other: &Duration) -> bool
[src]
fn gt(&self, other: &Duration) -> bool
[src]
fn ge(&self, other: &Duration) -> bool
[src]
impl Add<Duration> for Duration
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
impl<'_> Add<&'_ Duration> for Duration
[src]
type Output = Duration
The resulting type after applying the +
operator.
fn add(self, rhs: &Self) -> Self
[src]
impl Add<Duration> for Instant
[src]
A Duration
can be added to an Instant
, moving the Instant
forwards in time.
type Output = Self
The resulting type after applying the +
operator.
fn add(self, d: Duration) -> Self
[src]
impl Sub<Duration> for Duration
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self
[src]
impl<'_> Sub<&'_ Duration> for Duration
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: &Self) -> Self
[src]
impl Sub<Duration> for Instant
[src]
A Duration
can be subtracted from an Instant
, moving the Instant
backwards in time.
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, d: Duration) -> Self
[src]
impl AddAssign<Duration> for Duration
[src]
fn add_assign(&mut self, rhs: Self)
[src]
impl AddAssign<Duration> for Instant
[src]
fn add_assign(&mut self, d: Duration)
[src]
impl SubAssign<Duration> for Duration
[src]
fn sub_assign(&mut self, rhs: Self)
[src]
impl SubAssign<Duration> for Instant
[src]
Subtracts a Duration
from self
.
fn sub_assign(&mut self, d: Duration)
[src]
impl Clone for Duration
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom 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> From for T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,