Skip to content

Commit

Permalink
Add Publisher::can_loan_msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
mvukov committed Nov 24, 2024
1 parent 066dd7c commit 042c456
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rclrs/src/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,13 @@ 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 042c456

Please sign in to comment.