Struct rosrust::Time [−][src]
Expand description
ROS representation of time, with nanosecond precision
Fields
sec: u32
Number of seconds.
nsec: u32
Number of nanoseconds inside the current second.
Implementations
Creates a time of the given number of nanoseconds.
Examples
assert_eq!(Time::from_nanos(0), Time { sec: 0, nsec: 0 });
assert_eq!(Time::from_nanos(12_000_000_123), Time { sec: 12, nsec: 123 });
Creates a time of the given number of seconds.
Examples
assert_eq!(Time::from_seconds(0), Time { sec: 0, nsec: 0 });
assert_eq!(Time::from_seconds(12), Time { sec: 12, nsec: 0 });
Returns the number of nanoseconds in the time.
Examples
assert_eq!(Time { sec: 0, nsec: 0 }.nanos(), 0);
assert_eq!(Time { sec: 12, nsec: 123 }.nanos(), 12_000_000_123);
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Time, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Time, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Time
impl UnwindSafe for Time
Blanket Implementations
Mutably borrows from an owned value. Read more