pub enum Message {
Text(String),
Binary(Bytes),
Close(Option<CloseFrame>),
}Expand description
One WebSocket message, in the vocabulary every backend can speak.
Not #[non_exhaustive]: see the module doc. Nothing here is published,
so a new variant costs a rebase inside this workspace and a compile
error is what a backend author should get.
Variants§
Text(String)
A text message. RFC 6455 §5.6 requires it to be valid UTF-8, which
String is by construction — a backend that reads invalid UTF-8
off the wire owes an error, not a lossy conversion.
Binary(Bytes)
A binary message.
Close(Option<CloseFrame>)
Trait Implementations§
impl Eq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl !Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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