pub struct StreamMap { /* private fields */ }
Expand description
A wrapper for a map of Strings to PacketStreams.
Implementations§
Source§impl StreamMap
impl StreamMap
Sourcepub fn take(&mut self, key: &str) -> Result<PacketStream, Error>
pub fn take(&mut self, key: &str) -> Result<PacketStream, Error>
Remove a stream from the map by key name.
Sourcepub async fn next_for(&mut self, key: &str) -> Option<Result<Packet, Error>>
pub async fn next_for(&mut self, key: &str) -> Option<Result<Packet, Error>>
Take the next packet from the stream keyed by key
.
Sourcepub async fn next_set(
&mut self,
) -> Result<Option<HashMap<String, Packet>>, Error>
pub async fn next_set( &mut self, ) -> Result<Option<HashMap<String, Packet>>, Error>
Take one packet from each stream in the map. Returns an error if a complete set can’t be made.
pub fn init(&mut self, port: &str) -> PacketSender
Trait Implementations§
Source§impl IntoIterator for StreamMap
impl IntoIterator for StreamMap
Auto Trait Implementations§
impl Freeze for StreamMap
impl !RefUnwindSafe for StreamMap
impl Send for StreamMap
impl !Sync for StreamMap
impl Unpin for StreamMap
impl !UnwindSafe for StreamMap
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