pub struct WebSocketWriter { /* private fields */ }Expand description
Sending part of web sockets connection
Implementations§
Source§impl WebSocketWriter
impl WebSocketWriter
pub const FIN_RSV: u8 = 0x80
pub const OP_CODE_CONTINUATION: u8 = 0x00
pub const OP_CODE_TEXT: u8 = 0x01
pub const OP_CODE_BINARY: u8 = 0x02
pub const OP_CODE_CLOSE: u8 = 0x08
pub const OP_CODE_PING: u8 = 0x09
pub const OP_CODE_PONG: u8 = 0x0A
pub fn new_unchecked(write_stream: OwnedWriteHalf) -> Self
Sourcepub async fn text<A: Into<String>>(&self, text: A) -> Result<(), Error>
pub async fn text<A: Into<String>>(&self, text: A) -> Result<(), Error>
Sends a text message through the websockets connection
Sourcepub async fn bytes<A: Into<Vec<u8>>>(&self, bytes: A) -> Result<(), Error>
pub async fn bytes<A: Into<Vec<u8>>>(&self, bytes: A) -> Result<(), Error>
Sends a text message through the websockets connection
Sourcepub async fn ping<A: Into<Vec<u8>>>(&self, payload: A) -> Result<(), Error>
pub async fn ping<A: Into<Vec<u8>>>(&self, payload: A) -> Result<(), Error>
Sends a ping message through the websockets connection
Auto Trait Implementations§
impl Freeze for WebSocketWriter
impl RefUnwindSafe for WebSocketWriter
impl Send for WebSocketWriter
impl Sync for WebSocketWriter
impl Unpin for WebSocketWriter
impl UnsafeUnpin for WebSocketWriter
impl UnwindSafe for WebSocketWriter
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