[−][src]Struct dw1000::time::Duration
A duration between two instants in DW1000 system time
Internally uses the same 40-bit timestamps that the DW1000 uses.
Methods
impl Duration
[src]
pub fn new(value: u64) -> Option<Self>
[src]
Creates a new instance of Duration
The given value must fit in a 40-bit timestamp, so:
0 <= value
<= 2^40 - 1
Returns Some(...)
, if value
is within the valid range, None
if it
isn't.
Example
use dw1000::time::{ TIME_MAX, Duration, }; let valid_duration = Duration::new(TIME_MAX); let invalid_duration = Duration::new(TIME_MAX + 1); assert!(valid_duration.is_some()); assert!(invalid_duration.is_none());
pub fn from_nanos(nanos: u32) -> Self
[src]
Creates an instance of Duration
from a number of nanoseconds
pub fn value(&self) -> u64
[src]
Returns the raw 40-bit timestamp
The returned value is guaranteed to be in the following range:
0 <= value
<= 2^40 - 1
Trait Implementations
impl Add<Duration> for Instant
[src]
type Output = Instant
The resulting type after applying the +
operator.
fn add(self, rhs: Duration) -> Self::Output
[src]
impl Clone for Duration
[src]
fn clone(&self) -> Duration
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Duration
[src]
impl Debug for Duration
[src]
impl<'de> Deserialize<'de> for Duration
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Duration
[src]
impl PartialEq<Duration> for Duration
[src]
impl Serialize for Duration
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Duration
[src]
impl StructuralPartialEq for Duration
[src]
Auto Trait Implementations
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: Deserialize<'de>,
[src]
T: 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, 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>,