pub struct Time {
pub sec: i32,
pub nanosec: u32,
}Expand description
ROS Time representation
Matches builtin_interfaces/msg/Time:
sec: Seconds since epoch (signed for pre-epoch times)nanosec: Nanoseconds within the second (0-999999999)
Fields§
§sec: i32Seconds component
nanosec: u32Nanoseconds component (0-999999999)
Implementations§
Source§impl Time
impl Time
Sourcepub const fn from_nanos(nanos: i64) -> Time
pub const fn from_nanos(nanos: i64) -> Time
Create a Time from nanoseconds since epoch
Sourcepub const fn from_duration(d: Duration) -> Time
pub const fn from_duration(d: Duration) -> Time
Create a Time from a Duration (treating duration as time since epoch)
Sourcepub const fn as_duration(&self) -> Duration
pub const fn as_duration(&self) -> Duration
Convert to Duration (treating time as duration since epoch)
Sourcepub fn from_secs_f64(secs: f64) -> Time
pub fn from_secs_f64(secs: f64) -> Time
Create a Time from seconds (float)
Sourcepub fn to_secs_f64(&self) -> f64
pub fn to_secs_f64(&self) -> f64
Convert to seconds (float)
Trait Implementations§
Source§impl Deserialize for Time
impl Deserialize for Time
Source§fn deserialize(reader: &mut CdrReader<'_>) -> Result<Time, DeserError>
fn deserialize(reader: &mut CdrReader<'_>) -> Result<Time, DeserError>
Deserialize a value from the CDR reader
Source§impl Ord for Time
impl Ord for Time
Source§impl PartialOrd for Time
impl PartialOrd for Time
impl Copy for Time
impl Eq for Time
impl StructuralPartialEq for Time
Auto Trait Implementations§
impl Freeze for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnsafeUnpin for Time
impl UnwindSafe for Time
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more