pub struct WebSocketSession { /* private fields */ }Implementations§
Source§impl WebSocketSession
impl WebSocketSession
pub fn id(&self) -> &str
pub fn is_open(&self) -> bool
pub async fn send_text(&self, text: impl Into<String>) -> Result<()>
pub async fn send_binary(&self, data: impl Into<Bytes>) -> Result<()>
pub async fn ping(&self, data: impl Into<Bytes>) -> Result<()>
pub async fn pong(&self, data: impl Into<Bytes>) -> Result<()>
pub async fn close(&self, frame: Option<WebSocketCloseFrame>) -> Result<()>
Trait Implementations§
Source§impl Clone for WebSocketSession
impl Clone for WebSocketSession
Source§fn clone(&self) -> WebSocketSession
fn clone(&self) -> WebSocketSession
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for WebSocketSession
impl !UnwindSafe for WebSocketSession
impl Freeze for WebSocketSession
impl Send for WebSocketSession
impl Sync for WebSocketSession
impl Unpin for WebSocketSession
impl UnsafeUnpin for WebSocketSession
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more