pub struct WebSocketConnection { /* private fields */ }Expand description
A Steam WebSocket connection.
Implementations§
Source§impl WebSocketConnection
impl WebSocketConnection
Sourcepub fn new(factory: Arc<dyn WebSocketFactory>) -> Self
pub fn new(factory: Arc<dyn WebSocketFactory>) -> Self
Creates a websocket connection that uses the given factory to open sockets.
Sourcepub fn new_tungstenite() -> Self
pub fn new_tungstenite() -> Self
Creates a websocket connection that opens tokio-tungstenite sockets.
Sourcepub fn new_tungstenite_for_host(host: impl Into<String>) -> Self
pub fn new_tungstenite_for_host(host: impl Into<String>) -> Self
Opens tokio-tungstenite sockets to the given host name. The host name
is kept because it’s the TLS server name.
Sourcepub fn new_tungstenite_for_host_with_user_agent(
host: impl Into<String>,
user_agent: impl Into<String>,
) -> Self
pub fn new_tungstenite_for_host_with_user_agent( host: impl Into<String>, user_agent: impl Into<String>, ) -> Self
Like new_tungstenite_for_host, and
also sends the given User-Agent with the upgrade request.
Sourcepub fn subscribe_net_msg_received(&self) -> Receiver<NetMsgEventArgs>
pub fn subscribe_net_msg_received(&self) -> Receiver<NetMsgEventArgs>
Subscribes to the NetMsgReceived event.
Sourcepub fn subscribe_connected(&self) -> Receiver<()>
pub fn subscribe_connected(&self) -> Receiver<()>
Subscribes to the Connected event.
Sourcepub fn subscribe_disconnected(&self) -> Receiver<DisconnectedEventArgs>
pub fn subscribe_disconnected(&self) -> Receiver<DisconnectedEventArgs>
Subscribes to the Disconnected event.
Trait Implementations§
Source§impl ConnectionEvents for WebSocketConnection
impl ConnectionEvents for WebSocketConnection
Source§fn events(&self) -> UnboundedReceiver<ConnectionEvent>
fn events(&self) -> UnboundedReceiver<ConnectionEvent>
Subscribes to all three events as one stream. Read more
Source§fn net_msg_received(&self) -> Receiver<NetMsgEventArgs>
fn net_msg_received(&self) -> Receiver<NetMsgEventArgs>
Subscribes to the
NetMsgReceived event.Source§fn disconnected(&self) -> Receiver<DisconnectedEventArgs>
fn disconnected(&self) -> Receiver<DisconnectedEventArgs>
Subscribes to the
Disconnected event.Source§impl Debug for WebSocketConnection
impl Debug for WebSocketConnection
Source§impl IConnection for WebSocketConnection
impl IConnection for WebSocketConnection
Source§fn current_end_point(&self) -> Option<SocketAddr>
fn current_end_point(&self) -> Option<SocketAddr>
The remote endpoint of the current connection. Read more
Source§fn protocol_types(&self) -> ProtocolTypes
fn protocol_types(&self) -> ProtocolTypes
The type of communication protocol that this connection uses.
Source§fn connect<'life0, 'async_trait>(
&'life0 self,
end_point: SocketAddr,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), SteamError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self,
end_point: SocketAddr,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), SteamError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connects to the specified endpoint.
Source§fn disconnect<'life0, 'async_trait>(
&'life0 self,
user_initiated: bool,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 self,
user_initiated: bool,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Disconnects.
user_initiated is true when the caller asked for it.Auto Trait Implementations§
impl !RefUnwindSafe for WebSocketConnection
impl !UnwindSafe for WebSocketConnection
impl Freeze for WebSocketConnection
impl Send for WebSocketConnection
impl Sync for WebSocketConnection
impl Unpin for WebSocketConnection
impl UnsafeUnpin for WebSocketConnection
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