pub enum SocketMessage {
Binary(Vec<u8>),
Text(String),
Ping(Vec<u8>),
Pong(Vec<u8>),
Close,
}Expand description
Generic socket message.
Variants§
Binary(Vec<u8>)
Binary message.
Text(String)
Text message.
Ping(Vec<u8>)
Ping message.
Pong(Vec<u8>)
Pong message.
Close
Close message.
Trait Implementations§
Source§impl Debug for SocketMessage
impl Debug for SocketMessage
Source§impl From<Message> for SocketMessage
impl From<Message> for SocketMessage
Source§impl From<SocketMessage> for Message
impl From<SocketMessage> for Message
Source§fn from(msg: SocketMessage) -> WsMessage
fn from(msg: SocketMessage) -> WsMessage
Converts to this type from the input type.
Source§impl From<WsMessage> for SocketMessage
impl From<WsMessage> for SocketMessage
Source§impl<S> Sink<SocketMessage> for WebSocket<S>
impl<S> Sink<SocketMessage> for WebSocket<S>
Source§type Error = Box<dyn Error + Sync + Send>
type Error = Box<dyn Error + Sync + Send>
The type of value produced by the sink when an error occurs.
Source§fn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>
fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Attempts to prepare the
Sink to receive a value. Read moreSource§fn start_send(
self: Pin<&mut Self>,
item: SocketMessage,
) -> Result<(), Self::Error>
fn start_send( self: Pin<&mut Self>, item: SocketMessage, ) -> Result<(), Self::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 moreSource§impl Sink<SocketMessage> for WebSocket
impl Sink<SocketMessage> for WebSocket
Source§type Error = Box<dyn Error + Sync + Send>
type Error = Box<dyn Error + Sync + Send>
The type of value produced by the sink when an error occurs.
Source§fn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>
fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Attempts to prepare the
Sink to receive a value. Read moreSource§fn start_send(
self: Pin<&mut Self>,
item: SocketMessage,
) -> Result<(), Self::Error>
fn start_send( self: Pin<&mut Self>, item: SocketMessage, ) -> Result<(), Self::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 moreAuto Trait Implementations§
impl Freeze for SocketMessage
impl RefUnwindSafe for SocketMessage
impl Send for SocketMessage
impl Sync for SocketMessage
impl Unpin for SocketMessage
impl UnsafeUnpin for SocketMessage
impl UnwindSafe for SocketMessage
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