pub struct WebSocketWriter { /* private fields */ }Expand description
Sending part of web sockets connection
Implementations§
Source§impl WebSocketWriter
impl WebSocketWriter
pub const FIN_RSV: u8 = 128u8
pub const OP_CODE_CONTINUATION: u8 = 0u8
pub const OP_CODE_TEXT: u8 = 1u8
pub const OP_CODE_BINARY: u8 = 2u8
pub const OP_CODE_CLOSE: u8 = 8u8
pub const OP_CODE_PING: u8 = 9u8
pub const OP_CODE_PONG: u8 = 10u8
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 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