Struct ros2_client::ros_time::ROSDuration

source ·
pub struct ROSDuration { /* private fields */ }
Expand description

Difference between ROSTime or SystemTime instances

Supports conversions to/from

Implementations§

source§

impl ROSDuration

source

pub const fn from_nanos(nanos: i64) -> Self

Construct from nanosecond count

source

pub const fn to_nanos(&self) -> i64

Convert to nanoseconds. Returns None if i64 would overflow.

Trait Implementations§

source§

impl Add<ROSDuration> for ROSTime

§

type Output = ROSTime

The resulting type after applying the + operator.
source§

fn add(self, other: ROSDuration) -> ROSTime

Performs the + operation. Read more
source§

impl Add for ROSDuration

Note: panics on overflow/underflow like integer arithmetic

§

type Output = ROSDuration

The resulting type after applying the + operator.
source§

fn add(self, other: ROSDuration) -> ROSDuration

Performs the + operation. Read more
source§

impl From<ROSDuration> for Duration

source§

fn from(d: ROSDuration) -> Duration

Converts to this type from the input type.
source§

impl Sub<ROSDuration> for ROSTime

§

type Output = ROSTime

The resulting type after applying the - operator.
source§

fn sub(self, other: ROSDuration) -> ROSTime

Performs the - operation. Read more
source§

impl Sub for ROSDuration

Note: panics on overflow/underflow like integer arithmetic

§

type Output = ROSDuration

The resulting type after applying the - operator.
source§

fn sub(self, other: ROSDuration) -> ROSDuration

Performs the - operation. Read more
source§

impl TryFrom<Duration> for ROSDuration

§

type Error = OutOfRangeError

The type returned in the event of a conversion error.
source§

fn try_from(std_duration: Duration) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ROSDuration> for Duration

§

type Error = OutOfRangeError

The type returned in the event of a conversion error.
source§

fn try_from(ros_duration: ROSDuration) -> Result<Duration, Self::Error>

Performs the conversion.
source§

impl TryFrom<TimeDelta> for ROSDuration

§

type Error = OutOfRangeError

The type returned in the event of a conversion error.
source§

fn try_from(c_duration: Duration) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

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

source§

fn vzip(self) -> V