pub struct AssembledMessage { /* private fields */ }Expand description
A whole message returned by a FragmentAssembler.
Implementations§
Source§impl AssembledMessage
impl AssembledMessage
Sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
The message bytes, header included. For a joined message the header has the more-fragments flag cleared and the total size.
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Consumes the message and returns its bytes.
Sourcepub fn segments(&self) -> &[Segment]
pub fn segments(&self) -> &[Segment]
Where each fragment after the first starts in the message, with the offset its alignment restarts at. Empty for an unfragmented message.
Sourcepub fn was_fragmented(&self) -> bool
pub fn was_fragmented(&self) -> bool
Whether the message was joined from fragments.
Sourcepub fn decode(&self) -> Result<(MessageHeader, Message)>
pub fn decode(&self) -> Result<(MessageHeader, Message)>
Decodes the message, keeping the alignment of each fragment. The
bodies get a copy of the bytes; into_decoded
shares them instead.
Sourcepub fn into_decoded(self) -> Result<(MessageHeader, Message)>
pub fn into_decoded(self) -> Result<(MessageHeader, Message)>
Decodes the message like decode, handing its
bytes to the bodies without copying them.
Trait Implementations§
Source§impl Clone for AssembledMessage
impl Clone for AssembledMessage
Source§impl Debug for AssembledMessage
impl Debug for AssembledMessage
impl Eq for AssembledMessage
Source§impl PartialEq for AssembledMessage
impl PartialEq for AssembledMessage
impl StructuralPartialEq for AssembledMessage
Auto Trait Implementations§
impl Freeze for AssembledMessage
impl RefUnwindSafe for AssembledMessage
impl Send for AssembledMessage
impl Sync for AssembledMessage
impl Unpin for AssembledMessage
impl UnsafeUnpin for AssembledMessage
impl UnwindSafe for AssembledMessage
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