pub struct Clock(_);
Implementations
sourceimpl Clock
impl Clock
sourcepub fn ros() -> Result<Self>
pub fn ros() -> Result<Self>
Construct a new Clock
with ros time
Examples
use rclrust::{Clock, ClockType};
let clock = Clock::ros().unwrap();
assert_eq!(clock.clock_type(), ClockType::RosTime);
sourcepub fn system() -> Result<Self>
pub fn system() -> Result<Self>
Construct a new Clock
with system time
Examples
use rclrust::{Clock, ClockType};
let clock = Clock::system().unwrap();
assert_eq!(clock.clock_type(), ClockType::SystemTime);
sourcepub fn steady() -> Result<Self>
pub fn steady() -> Result<Self>
Construct a new Clock
with steady time
Examples
use rclrust::{Clock, ClockType};
let clock = Clock::steady().unwrap();
assert_eq!(clock.clock_type(), ClockType::SteadyTime);
sourcepub fn now(&mut self) -> Result<Time>
pub fn now(&mut self) -> Result<Time>
Examples
use rclrust::{Clock, ClockType};
let mut clock = Clock::ros().unwrap();
let now = clock.now().unwrap();
println!("current time: {:?}", now);
sourcepub const fn clock_type(&self) -> ClockType
pub const fn clock_type(&self) -> ClockType
Examples
use rclrust::{Clock, ClockType};
let clock = Clock::ros().unwrap();
assert_eq!(clock.clock_type(), ClockType::RosTime);
Trait Implementations
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more