pub enum CompressedPayload {
Compressed(Bytes),
Uncompressed(Bytes),
}Expand description
Result of attempting to compress a payload.
Variants§
Compressed(Bytes)
Payload was compressed - contains raw gzip bytes. Should be sent as a binary WebSocket frame.
Uncompressed(Bytes)
Payload was not compressed - contains original JSON bytes. Should be sent as a text WebSocket frame (or binary, both work).
Implementations§
Source§impl CompressedPayload
impl CompressedPayload
Sourcepub fn is_compressed(&self) -> bool
pub fn is_compressed(&self) -> bool
Returns true if the payload is compressed.
Sourcepub fn into_bytes(self) -> Bytes
pub fn into_bytes(self) -> Bytes
Consumes self and returns the inner bytes.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CompressedPayload
impl RefUnwindSafe for CompressedPayload
impl Send for CompressedPayload
impl Sync for CompressedPayload
impl Unpin for CompressedPayload
impl UnwindSafe for CompressedPayload
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