pub struct Connection(/* private fields */);Expand description
A connection to the steam server
Implementations§
Source§impl Connection
impl Connection
Sourcepub async fn anonymous(
server_list: &ServerList,
) -> Result<Self, ConnectionError>
pub async fn anonymous( server_list: &ServerList, ) -> Result<Self, ConnectionError>
Start an anonymous client session on a new connection
Sourcepub async fn anonymous_server(
server_list: &ServerList,
) -> Result<Self, ConnectionError>
pub async fn anonymous_server( server_list: &ServerList, ) -> Result<Self, ConnectionError>
Start an anonymous server session on a new connection
Sourcepub async fn login<H: AuthConfirmationHandler, G: GuardDataStore>(
server_list: &ServerList,
account: &str,
password: &str,
guard_data_store: G,
confirmation_handler: H,
) -> Result<Self, ConnectionError>
pub async fn login<H: AuthConfirmationHandler, G: GuardDataStore>( server_list: &ServerList, account: &str, password: &str, guard_data_store: G, confirmation_handler: H, ) -> Result<Self, ConnectionError>
Start a client session on a new connection
pub async fn access( server_list: &ServerList, account: &str, access_token: &str, ) -> Result<Self, ConnectionError>
pub fn access_token(&self) -> Option<&str>
pub fn steam_id(&self) -> SteamID
pub fn session_id(&self) -> i32
pub fn cell_id(&self) -> u32
pub fn public_ip(&self) -> Option<IpAddr>
pub fn ip_country_code(&self) -> Option<String>
pub fn set_timeout(&mut self, timeout: Duration)
Sourcepub fn take_unprocessed(&self) -> Vec<RawNetMessage>
pub fn take_unprocessed(&self) -> Vec<RawNetMessage>
Get all messages that haven’t been filtered by any of the filters
Note that at most 32 unprocessed connections are stored and calling this method clears the buffer
Source§impl Connection
impl Connection
Sourcepub async fn game_coordinator<Handshake: GCHandshake>(
&self,
handshake: &Handshake,
) -> Result<(GameCoordinator, Handshake::Welcome), NetworkError>
pub async fn game_coordinator<Handshake: GCHandshake>( &self, handshake: &Handshake, ) -> Result<(GameCoordinator, Handshake::Welcome), NetworkError>
Create new GameCoordinator instance using this connection
Trait Implementations§
Source§impl Clone for Connection
impl Clone for Connection
Source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Connection
impl !RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection
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§impl<C> ConnectionTrait for Cwhere
C: ConnectionImpl,
impl<C> ConnectionTrait for Cwhere
C: ConnectionImpl,
Source§fn on_notification<T>(
&self,
) -> impl Stream<Item = Result<T, NetworkError>> + 'staticwhere
T: ServiceMethodRequest,
fn on_notification<T>(
&self,
) -> impl Stream<Item = Result<T, NetworkError>> + 'staticwhere
T: ServiceMethodRequest,
Listen for notification messages from steam
Source§fn one_with_header<T>(
&self,
) -> impl Future<Output = Result<(NetMessageHeader, T), NetworkError>> + 'staticwhere
T: NetMessage + 'static,
fn one_with_header<T>(
&self,
) -> impl Future<Output = Result<(NetMessageHeader, T), NetworkError>> + 'staticwhere
T: NetMessage + 'static,
Wait for one message of a specific kind, also returning the header
Source§fn one<T>(&self) -> impl Future<Output = Result<T, NetworkError>> + 'staticwhere
T: NetMessage + 'static,
fn one<T>(&self) -> impl Future<Output = Result<T, NetworkError>> + 'staticwhere
T: NetMessage + 'static,
Wait for one message of a specific kind
Source§fn on_with_header<T>(
&self,
) -> impl Stream<Item = Result<(NetMessageHeader, T), NetworkError>> + 'staticwhere
T: NetMessage + 'static,
fn on_with_header<T>(
&self,
) -> impl Stream<Item = Result<(NetMessageHeader, T), NetworkError>> + 'staticwhere
T: NetMessage + 'static,
Listen to messages of a specific kind, also returning the header
Source§fn on<T>(&self) -> impl Stream<Item = Result<T, NetworkError>> + 'staticwhere
T: NetMessage + 'static,
fn on<T>(&self) -> impl Stream<Item = Result<T, NetworkError>> + 'staticwhere
T: NetMessage + 'static,
Listen to messages of a specific kind
Source§async fn service_method<Msg>(
&self,
msg: Msg,
) -> Result<<Msg as ServiceMethodRequest>::Response, NetworkError>where
Msg: ServiceMethodRequest,
async fn service_method<Msg>(
&self,
msg: Msg,
) -> Result<<Msg as ServiceMethodRequest>::Response, NetworkError>where
Msg: ServiceMethodRequest,
Send a rpc-request to steam, waiting for the matching rpc-response
Source§async fn job<Msg, Rsp>(&self, msg: Msg) -> Result<Rsp, NetworkError>where
Msg: NetMessage,
Rsp: NetMessage,
async fn job<Msg, Rsp>(&self, msg: Msg) -> Result<Rsp, NetworkError>where
Msg: NetMessage,
Rsp: NetMessage,
Send a message to steam, waiting for a response with the same job id
Source§fn job_multi<Msg, Rsp>(
&self,
msg: Msg,
) -> impl Stream<Item = Result<Rsp, NetworkError>> + Send
fn job_multi<Msg, Rsp>( &self, msg: Msg, ) -> impl Stream<Item = Result<Rsp, NetworkError>> + Send
Send a message to steam, receiving responses until the response marks that the response is complete
Source§fn send<Msg>(
&self,
msg: Msg,
) -> impl Future<Output = Result<(), NetworkError>> + Sendwhere
Msg: NetMessage,
fn send<Msg>(
&self,
msg: Msg,
) -> impl Future<Output = Result<(), NetworkError>> + Sendwhere
Msg: NetMessage,
Send a message to steam without waiting for a response
Source§fn send_with_kind<Msg, K>(
&self,
msg: Msg,
kind: K,
) -> impl Future<Output = Result<(), NetworkError>> + Sendwhere
Msg: NetMessage,
K: MsgKindEnum,
fn send_with_kind<Msg, K>(
&self,
msg: Msg,
kind: K,
) -> impl Future<Output = Result<(), NetworkError>> + Sendwhere
Msg: NetMessage,
K: MsgKindEnum,
Send a message to steam without waiting for a response, overwriting the kind of the message
Source§fn raw_send<Msg>(
&self,
header: NetMessageHeader,
msg: Msg,
) -> impl Future<Output = Result<(), NetworkError>> + Sendwhere
Msg: NetMessage,
fn raw_send<Msg>(
&self,
header: NetMessageHeader,
msg: Msg,
) -> impl Future<Output = Result<(), NetworkError>> + Sendwhere
Msg: NetMessage,
Send a message to steam without waiting for a response, with a customized header↑
Source§fn raw_send_with_kind<Msg, K>(
&self,
header: NetMessageHeader,
msg: Msg,
kind: K,
is_protobuf: bool,
) -> impl Future<Output = Result<(), NetworkError>> + Sendwhere
Msg: EncodableMessage,
K: MsgKindEnum,
fn raw_send_with_kind<Msg, K>(
&self,
header: NetMessageHeader,
msg: Msg,
kind: K,
is_protobuf: bool,
) -> impl Future<Output = Result<(), NetworkError>> + Sendwhere
Msg: EncodableMessage,
K: MsgKindEnum,
Send a message to steam without waiting for a response, with a customized header↑ and overwriting the kind of the message