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>

source

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 use Client::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.

source

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>

source

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.

source

pub fn utils(&self) -> Utils<Manager>

Returns an accessor to the steam utils interface

source

pub fn matchmaking(&self) -> Matchmaking<Manager>

Returns an accessor to the steam matchmaking interface

source

pub fn networking(&self) -> Networking<Manager>

Returns an accessor to the steam networking interface

source

pub fn apps(&self) -> Apps<Manager>

Returns an accessor to the steam apps interface

source

pub fn friends(&self) -> Friends<Manager>

Returns an accessor to the steam friends interface

source

pub fn input(&self) -> Input<Manager>

Returns an accessor to the steam input interface

source

pub fn user(&self) -> User<Manager>

Returns an accessor to the steam user interface

source

pub fn user_stats(&self) -> UserStats<Manager>

Returns an accessor to the steam user stats interface

source

pub fn remote_play(&self) -> RemotePlay<Manager>

Returns an accessor to the steam remote play interface

source

pub fn remote_storage(&self) -> RemoteStorage<Manager>

Returns an accessor to the steam remote storage interface

source

pub fn ugc(&self) -> UGC<Manager>

Returns an accessor to the steam UGC interface (steam workshop)

source

pub fn networking_messages(&self) -> NetworkingMessages<Manager>

source

pub fn networking_sockets(&self) -> NetworkingSockets<Manager>

source

pub fn networking_utils(&self) -> NetworkingUtils<Manager>

Trait Implementations§

source§

impl<Manager> Clone for Client<Manager>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Manager: Send + Sync> Send for Client<Manager>

source§

impl<Manager: Send + Sync> Sync for Client<Manager>

Auto Trait Implementations§

§

impl<Manager> RefUnwindSafe for Client<Manager>
where Manager: RefUnwindSafe,

§

impl<Manager> Unpin for Client<Manager>

§

impl<Manager> UnwindSafe for Client<Manager>
where Manager: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.