Skip to content

Commit 885f415

Browse files
authored
Add Publisher::can_loan_msgs (#434)
* Add Publisher::can_loan_msgs * Fix formatting
1 parent 217f42c commit 885f415

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rclrs/src/publisher.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ where
229229
msg_ptr: msg_ptr as *mut T,
230230
})
231231
}
232+
233+
/// Returns true if message loans are possible, false otherwise.
234+
pub fn can_loan_messages(&self) -> bool {
235+
unsafe { rcl_publisher_can_loan_messages(&*self.handle.rcl_publisher.lock().unwrap()) }
236+
}
232237
}
233238

234239
/// Convenience trait for [`Publisher::publish`].

0 commit comments

Comments
 (0)