Struct steamworks::Client [−][src]
pub struct Client<Manager = ClientManager> { /* fields omitted */ }
Expand description
The main entry point into the steam client.
This provides access to all of the steamworks api that clients can use.
Implementations
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.
pub fn init_app<ID: Into<AppId>>(
app_id: ID
) -> SResult<(Client<ClientManager>, SingleClient<ClientManager>)>
pub fn init_app<ID: Into<AppId>>(
app_id: ID
) -> SResult<(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.
pub fn register_callback<C, F>(&self, f: F) -> CallbackHandle<Manager> where
C: Callback,
F: FnMut(C) + 'static + Send,
pub fn register_callback<C, F>(&self, f: F) -> CallbackHandle<Manager> where
C: Callback,
F: FnMut(C) + 'static + Send,
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.
Returns an accessor to the steam matchmaking interface
Returns an accessor to the steam networking interface
Returns an accessor to the steam user stats interface
Returns an accessor to the steam remote storage interface
Returns an accessor to the steam UGC interface (steam workshop)
Trait Implementations
Auto Trait Implementations
impl<Manager> RefUnwindSafe for Client<Manager> where
Manager: RefUnwindSafe,
impl<Manager> UnwindSafe for Client<Manager> where
Manager: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more