Trait graphql_ws_client::websockets::WebsocketMessage
source Β· 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;
}
πDeprecated since 0.8.0-rc.1: WebsockeMessage is only used for the deprecated AsyncWebsocketClient. You should update to use Client instead
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 new(text: String) -> Self
πDeprecated since 0.8.0-rc.1: WebsockeMessage is only used for the deprecated AsyncWebsocketClient. You should update to use Client instead
fn new(text: String) -> Self
Constructs a new message with the given text
sourcefn text(&self) -> Option<&str>
πDeprecated since 0.8.0-rc.1: WebsockeMessage is only used for the deprecated AsyncWebsocketClient. You should update to use Client instead
fn text(&self) -> Option<&str>
Returns the text (if there is any) contained in this message
sourcefn error_message(&self) -> Option<String>
πDeprecated since 0.8.0-rc.1: WebsockeMessage is only used for the deprecated AsyncWebsocketClient. You should update to use Client instead
fn error_message(&self) -> Option<String>
Returns the text (if there is any) of the error
sourcefn is_ping(&self) -> bool
πDeprecated since 0.8.0-rc.1: WebsockeMessage is only used for the deprecated AsyncWebsocketClient. You should update to use Client instead
fn is_ping(&self) -> bool
Returns true if this message is a websocket ping.
Object SafetyΒ§
This trait is not object safe.
Implementations on Foreign TypesΒ§
sourceΒ§impl WebsocketMessage for Message
impl WebsocketMessage for Message
Β§type Error = Error
type Error = Error
πDeprecated since 0.8.0-rc.1: WebsockeMessage is only used for the deprecated AsyncWebsocketClient. You should update to use Client instead
sourceΒ§fn new(text: String) -> Self
fn new(text: String) -> Self
πDeprecated since 0.8.0-rc.1: WebsockeMessage is only used for the deprecated AsyncWebsocketClient. You should update to use Client instead
sourceΒ§fn text(&self) -> Option<&str>
fn text(&self) -> Option<&str>
πDeprecated since 0.8.0-rc.1: WebsockeMessage is only used for the deprecated AsyncWebsocketClient. You should update to use Client instead
sourceΒ§fn error_message(&self) -> Option<String>
fn error_message(&self) -> Option<String>
πDeprecated since 0.8.0-rc.1: WebsockeMessage is only used for the deprecated AsyncWebsocketClient. You should update to use Client instead
sourceΒ§fn is_ping(&self) -> bool
fn is_ping(&self) -> bool
πDeprecated since 0.8.0-rc.1: WebsockeMessage is only used for the deprecated AsyncWebsocketClient. You should update to use Client instead