Struct steamworks::Client
source · pub struct Client<Manager = ClientManager> { /* private fields */ }
Expand description
The main entry point into the steam client.
This provides access to all of the steamworks api that clients can use.
Implementations§
source§impl Client<ClientManager>
impl Client<ClientManager>
sourcepub fn init() -> SIResult<(Client<ClientManager>, SingleClient<ClientManager>)>
pub fn init() -> SIResult<(Client<ClientManager>, SingleClient<ClientManager>)>
Attempts to initialize the steamworks api and returns a client to access the rest of the api.
This should only ever have one instance per a program.
§Errors
This can fail if:
-
The steam client isn’t running
-
The app ID of the game couldn’t be determined.
If the game isn’t being run through steam this can be provided by placing a
steam_appid.txt
with the ID inside in the current working directory. Alternatively, you can useClient::init_app(<app_id>)
to force a specific app ID. -
The game isn’t running on the same user/level as the steam client
-
The user doesn’t own a license for the game.
-
The app ID isn’t completely set up.
sourcepub fn init_app<ID: Into<AppId>>(
app_id: ID
) -> SIResult<(Client<ClientManager>, SingleClient<ClientManager>)>
pub fn init_app<ID: Into<AppId>>( app_id: ID ) -> SIResult<(Client<ClientManager>, SingleClient<ClientManager>)>
Attempts to initialize the steamworks api for a specified app ID and returns a client to access the rest of the api.
This should only ever have one instance per a program.
§Errors
This can fail if:
- The steam client isn’t running
- The game isn’t running on the same user/level as the steam client
- The user doesn’t own a license for the game.
- The app ID isn’t completely set up.
source§impl<Manager> Client<Manager>
impl<Manager> Client<Manager>
sourcepub fn register_callback<C, F>(&self, f: F) -> CallbackHandle<Manager>
pub fn register_callback<C, F>(&self, f: F) -> CallbackHandle<Manager>
Registers the passed function as a callback for the given type.
The callback will be run on the thread that run_callbacks
is called when the event arrives.
sourcepub fn matchmaking(&self) -> Matchmaking<Manager>
pub fn matchmaking(&self) -> Matchmaking<Manager>
Returns an accessor to the steam matchmaking interface
sourcepub fn networking(&self) -> Networking<Manager>
pub fn networking(&self) -> Networking<Manager>
Returns an accessor to the steam networking interface
sourcepub fn user_stats(&self) -> UserStats<Manager>
pub fn user_stats(&self) -> UserStats<Manager>
Returns an accessor to the steam user stats interface
sourcepub fn remote_play(&self) -> RemotePlay<Manager>
pub fn remote_play(&self) -> RemotePlay<Manager>
Returns an accessor to the steam remote play interface
sourcepub fn remote_storage(&self) -> RemoteStorage<Manager>
pub fn remote_storage(&self) -> RemoteStorage<Manager>
Returns an accessor to the steam remote storage interface
sourcepub fn ugc(&self) -> UGC<Manager>
pub fn ugc(&self) -> UGC<Manager>
Returns an accessor to the steam UGC interface (steam workshop)