Enum async_graphql::http::WsMessage
source · pub enum WsMessage {
Text(String),
Close(u16, String),
}
Expand description
An enum representing the various forms of a WebSocket message.
Variants§
Implementations§
source§impl WsMessage
impl WsMessage
sourcepub fn unwrap_text(self) -> String
pub fn unwrap_text(self) -> String
Returns the contained WsMessage::Text value, consuming the self
value.
Because this function may panic, its use is generally discouraged.
§Panics
Panics if the self value not equals WsMessage::Text.
sourcepub fn unwrap_close(self) -> (u16, String)
pub fn unwrap_close(self) -> (u16, String)
Returns the contained WsMessage::Close value, consuming the self
value.
Because this function may panic, its use is generally discouraged.
§Panics
Panics if the self value not equals WsMessage::Close.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WsMessage
impl RefUnwindSafe for WsMessage
impl Send for WsMessage
impl Sync for WsMessage
impl Unpin for WsMessage
impl UnwindSafe for WsMessage
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)