pub struct Clock(_);

Implementations

Construct a new Clock with ros time

Examples
use rclrust::{Clock, ClockType};

let clock = Clock::ros().unwrap();
assert_eq!(clock.clock_type(), ClockType::RosTime);

Construct a new Clock with system time

Examples
use rclrust::{Clock, ClockType};

let clock = Clock::system().unwrap();
assert_eq!(clock.clock_type(), ClockType::SystemTime);

Construct a new Clock with steady time

Examples
use rclrust::{Clock, ClockType};

let clock = Clock::steady().unwrap();
assert_eq!(clock.clock_type(), ClockType::SteadyTime);
Examples
use rclrust::{Clock, ClockType};

let mut clock = Clock::ros().unwrap();
let now = clock.now().unwrap();
println!("current time: {:?}", now);
Examples
use rclrust::{Clock, ClockType};

let clock = Clock::ros().unwrap();
assert_eq!(clock.clock_type(), ClockType::RosTime);
Examples
use rclrust::{Clock, ClockType};

let mut clock = Clock::ros().unwrap();
assert!(clock.is_valid());

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.