Skip to content

Commit

Permalink
Add Publisher::can_loan_msgs (#434)
Browse files Browse the repository at this point in the history
* Add Publisher::can_loan_msgs

* Fix formatting
  • Loading branch information
mvukov authored Nov 25, 2024
1 parent 217f42c commit 885f415
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rclrs/src/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ where
msg_ptr: msg_ptr as *mut T,
})
}

/// Returns true if message loans are possible, false otherwise.
pub fn can_loan_messages(&self) -> bool {
unsafe { rcl_publisher_can_loan_messages(&*self.handle.rcl_publisher.lock().unwrap()) }
}
}

/// Convenience trait for [`Publisher::publish`].
Expand Down

0 comments on commit 885f415

Please sign in to comment.