Fields
nanosecs: i64
clock_type: ClockType
Implementations
sourceimpl Time
impl Time
sourcepub fn new(secs: i32, nanosecs: u32, clock_type: ClockType) -> Self
pub fn new(secs: i32, nanosecs: u32, clock_type: ClockType) -> Self
Examples
use rclrust::{ClockType, Time};
let time = Time::new(10, 100000, ClockType::RosTime);
sourcepub const fn from_nanosecs(nanosecs: i64, clock_type: ClockType) -> Self
pub const fn from_nanosecs(nanosecs: i64, clock_type: ClockType) -> Self
Examples
use rclrust::{ClockType, Time};
let time = Time::from_nanosecs(100000, ClockType::RosTime);
sourcepub fn from_ros_msg(time_msg: &Time, clock_type: ClockType) -> Self
pub fn from_ros_msg(time_msg: &Time, clock_type: ClockType) -> Self
Examples
use rclrust::{ClockType, Time};
use rclrust_msg::builtin_interfaces;
let time_msg = builtin_interfaces::msg::Time {
sec: 5,
nanosec: 10,
};
let time = Time::from_ros_msg(&time_msg, ClockType::RosTime);
assert_eq!(time, Time::new(5, 10, ClockType::RosTime));
sourcepub fn to_ros_msg(self) -> Time
pub fn to_ros_msg(self) -> Time
Examples
use rclrust::{ClockType, Time};
use rclrust_msg::builtin_interfaces;
let time = Time::new(5, 10, ClockType::RosTime);
let time_msg = builtin_interfaces::msg::Time {
sec: 5,
nanosec: 10,
};
assert_eq!(time.to_ros_msg(), time_msg);
Trait Implementations
impl Copy for Time
impl Eq for Time
impl StructuralEq for Time
impl StructuralPartialEq for Time
Auto Trait Implementations
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnwindSafe for Time
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more