File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,20 @@ pub enum ClockType {
1515}
1616
1717impl From < ClockType > for rcl_clock_type_t {
18+ /// Converts a `ClockType` enum variant into the corresponding `rcl_clock_type_t` value.
19+ ///
20+ /// This implementation maps each `ClockType` variant to the corresponding `rcl_clock_type_t`
21+ /// value defined in the ROS Client Library (RCL) bindings.
22+ ///
23+ /// # Examples
24+ ///
25+ /// ```
26+ /// use rclrs::clock::ClockType;
27+ ///
28+ /// let ros_time = ClockType::RosTime;
29+ /// let rcl_ros_time: rcl_clock_type_t = ros_time.into();
30+ /// assert_eq!(rcl_ros_time, rcl_clock_type_t::RCL_ROS_TIME);
31+ /// ```
1832 fn from ( clock_type : ClockType ) -> Self {
1933 match clock_type {
2034 ClockType :: RosTime => rcl_clock_type_t:: RCL_ROS_TIME ,
You can’t perform that action at this time.
0 commit comments