Enum async_graphql::http::WsMessage
source · [−]Expand description
An enum representing the various forms of a WebSocket message.
Variants
Text(String)
A text WebSocket message
Close(u16, String)
A close message with the close frame.
Implementations
sourceimpl 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 RefUnwindSafe for WsMessage
impl Send for WsMessage
impl Sync for WsMessage
impl Unpin for WsMessage
impl UnwindSafe for WsMessage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more