pub struct NotificationMap { /* private fields */ }Expand description
A safe wrapper around NIXL notification map
Implementations§
Source§impl NotificationMap
impl NotificationMap
Sourcepub fn len(&self) -> Result<usize, NixlError>
pub fn len(&self) -> Result<usize, NixlError>
Returns the number of agents that have notifications
Sourcepub fn agents(&self) -> NotificationMapAgentIterator<'_> ⓘ
pub fn agents(&self) -> NotificationMapAgentIterator<'_> ⓘ
Returns an iterator over the agent names that have notifications
Sourcepub fn get_notifications_size(
&self,
agent_name: &str,
) -> Result<usize, NixlError>
pub fn get_notifications_size( &self, agent_name: &str, ) -> Result<usize, NixlError>
Returns the number of notifications for a given agent
Sourcepub fn get_notifications(
&self,
agent_name: &str,
) -> Result<NotificationIterator<'_>, NixlError>
pub fn get_notifications( &self, agent_name: &str, ) -> Result<NotificationIterator<'_>, NixlError>
Returns an iterator over the notifications for a given agent
Sourcepub fn get_notification_bytes(
&self,
agent_name: &str,
index: usize,
) -> Result<Vec<u8>, NixlError>
pub fn get_notification_bytes( &self, agent_name: &str, index: usize, ) -> Result<Vec<u8>, NixlError>
Returns a specific notification for a given agent as raw bytes
Sourcepub fn take_notifs(&mut self) -> Result<HashMap<String, Vec<String>>, NixlError>
pub fn take_notifs(&mut self) -> Result<HashMap<String, Vec<String>>, NixlError>
Takes all notifications from the map, converting them to Strings, and clears the underlying C map for reuse.
Returns a HashMap where keys are agent names and values are vectors of notification strings for that agent.
If a notification's byte data is not valid UTF-8, this method will
return an error (NixlError::BackendError in current impl, ideally a specific UTF-8 error).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NotificationMap
impl RefUnwindSafe for NotificationMap
impl !Send for NotificationMap
impl !Sync for NotificationMap
impl Unpin for NotificationMap
impl UnwindSafe for NotificationMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more