Skip to content

Commit aaf2bb6

Browse files
Add method that take a duration
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
1 parent 8272efa commit aaf2bb6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

rclrs/src/qos.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,24 @@ impl QoSProfile {
241241
self.durability = QoSDurabilityPolicy::TransientLocal;
242242
self
243243
}
244+
245+
/// Sets the QoS profile deadline to the specified `Duration`.
246+
pub fn deadline(mut self, deadline: Duration) -> Self {
247+
self.deadline = QoSDuration::Custom(deadline);
248+
self
249+
}
250+
251+
/// Sets the QoS profile liveliness lease duration to the specified `Duration`.
252+
pub fn liveliness_lease_duration(mut self, lease_duration: Duration) -> Self {
253+
self.liveliness_lease_duration = QoSDuration::Custom(lease_duration);
254+
self
255+
}
256+
257+
/// Sets the QoS profile lifespan to the specified `Duration`.
258+
pub fn lifespan(mut self, lifespan: Duration) -> Self {
259+
self.lifespan = QoSDuration::Custom(lifespan);
260+
self
261+
}
244262
}
245263

246264
impl From<QoSHistoryPolicy> for rmw_qos_history_policy_t {

0 commit comments

Comments
 (0)