pub struct MessageBody { /* private fields */ }Expand description
Represents the message body, handling both raw and compressed forms.
Implementations§
Source§impl MessageBody
impl MessageBody
Sourcepub fn from_compressed(raw: Bytes, compressed: Bytes) -> Self
pub fn from_compressed(raw: Bytes, compressed: Bytes) -> Self
Creates a message body with both raw and compressed data.
Sourcepub fn compressed(&self) -> Option<&Bytes>
pub fn compressed(&self) -> Option<&Bytes>
Returns the compressed body, if available.
Sourcepub fn compressed_mut(&mut self) -> &mut Option<Bytes>
pub fn compressed_mut(&mut self) -> &mut Option<Bytes>
Returns a mutable reference to the compressed body.
Sourcepub fn is_compressed(&self) -> bool
pub fn is_compressed(&self) -> bool
Returns whether the body is compressed.
Sourcepub fn into_bytes(self) -> Bytes
pub fn into_bytes(self) -> Bytes
Consumes and returns the raw bytes.
Trait Implementations§
Source§impl AsRef<[u8]> for MessageBody
impl AsRef<[u8]> for MessageBody
Source§impl Clone for MessageBody
impl Clone for MessageBody
Source§fn clone(&self) -> MessageBody
fn clone(&self) -> MessageBody
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MessageBody
impl Debug for MessageBody
Source§impl Default for MessageBody
impl Default for MessageBody
Source§fn default() -> MessageBody
fn default() -> MessageBody
Returns the “default value” for a type. Read more
Source§impl From<&[u8]> for MessageBody
impl From<&[u8]> for MessageBody
Source§impl From<Bytes> for MessageBody
impl From<Bytes> for MessageBody
Auto Trait Implementations§
impl !Freeze for MessageBody
impl RefUnwindSafe for MessageBody
impl Send for MessageBody
impl Sync for MessageBody
impl Unpin for MessageBody
impl UnsafeUnpin for MessageBody
impl UnwindSafe for MessageBody
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