pub trait WebsocketMessage: Debug {
type Error: Error + Send + 'static;
// Required methods
fn new(text: String) -> Self;
fn text(&self) -> Option<&str>;
fn error_message(&self) -> Option<String>;
fn is_ping(&self) -> bool;
fn is_pong(&self) -> bool;
fn is_close(&self) -> bool;
}
Expand description
An abstraction around WebsocketMessages
graphql-ws-client doesn’t implement the websocket protocol itself. This trait provides part of the integration with websocket client libraries.
Required Associated Types§
Required Methods§
sourcefn error_message(&self) -> Option<String>
fn error_message(&self) -> Option<String>
Returns the text (if there is any) of the error
Object Safety§
This trait is not object safe.