Struct wick_packet::StreamMap
source · 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§
Auto Trait Implementations§
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