Skip to content

Commit

Permalink
added pop method to received messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob-JB committed Jun 23, 2024
1 parent 84f2013 commit e1b416b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/nevy_messaging/src/deserialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,15 @@ impl<T> ReceivedMessages<T> {
}
}

/// drains the internal queue
pub fn drain(&mut self) -> impl Iterator<Item = T> + '_ {
self.messages.drain(..)
}

/// pops one message of the front of the queue
pub fn pop(&mut self) -> Option<T> {
self.messages.pop_front()
}
}

fn insert_connection_components<C: Component>(
Expand Down

0 comments on commit e1b416b

Please sign in to comment.