pub enum Message {
Text(String),
Bytes(Vec<u8>),
}
Expand description
Message sent to and received from WebSocket.
Variants§
Trait Implementations§
Source§impl Sink<Message> for WebSocket
impl Sink<Message> for WebSocket
Source§type Error = WebSocketError
type Error = WebSocketError
The type of value produced by the sink when an error occurs.
Source§fn poll_ready(
self: Pin<&mut WebSocket>,
cx: &mut Context<'_>,
) -> Poll<Result<(), <WebSocket as Sink<Message>>::Error>>
fn poll_ready( self: Pin<&mut WebSocket>, cx: &mut Context<'_>, ) -> Poll<Result<(), <WebSocket as Sink<Message>>::Error>>
Attempts to prepare the
Sink
to receive a value. Read moreSource§fn start_send(
self: Pin<&mut WebSocket>,
item: Message,
) -> Result<(), <WebSocket as Sink<Message>>::Error>
fn start_send( self: Pin<&mut WebSocket>, item: Message, ) -> Result<(), <WebSocket as Sink<Message>>::Error>
Begin the process of sending a value to the sink.
Each call to this function must be preceded by a successful call to
poll_ready
which returned Poll::Ready(Ok(()))
. Read moreimpl 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 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