Trait wasmer_vnet::VirtualWebSocket
source · pub trait VirtualWebSocket: Debug + Send + Sync + 'static {
fn send(&mut self, data: Bytes) -> Result<usize>;
fn flush(&mut self) -> Result<()>;
fn recv(&mut self) -> Result<SocketReceive>;
}
Expand description
Interface used for sending and receiving data from a web socket
Required Methods§
sourcefn send(&mut self, data: Bytes) -> Result<usize>
fn send(&mut self, data: Bytes) -> Result<usize>
Sends out a datagram or stream of bytes on this socket
sourcefn recv(&mut self) -> Result<SocketReceive>
fn recv(&mut self) -> Result<SocketReceive>
Recv a packet from the socket