Struct orouter_wireless::MessagePool
source · pub struct MessagePool { /* private fields */ }
Expand description
Holds parts of multipart messages before all parts have arrived
Messages in vector under each prefix key are inserted at the correct index - are kept sorted example of the map
ⓘ
{
'3B prefix': \[\[part_1\], \[part_2\], \[part3\]\], // these are ordered
...
...
}
Implementations§
source§impl MessagePool
impl MessagePool
sourcepub fn try_insert(
&mut self,
msg: P2pMessagePart
) -> Result<Option<P2pMessage>, Error>
pub fn try_insert( &mut self, msg: P2pMessagePart ) -> Result<Option<P2pMessage>, Error>
Try insert another part of sliced message. Will return None
if this is not last (or the
only) message, else it will return just the data of this message (stripped of all the now
unnecessart protocol meta data)
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for MessagePool
impl Send for MessagePool
impl Sync for MessagePool
impl Unpin for MessagePool
impl UnwindSafe for MessagePool
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