1#[cfg(feature = "gas")]
2use crate::gas::GasSteamUser;
3#[cfg(feature = "remote")]
4use crate::remote::RemoteSteamUser;
5use crate::{
6 action::{ActionContext, ApiAction},
7 client::SteamUser,
8 error::SteamUserError,
9 steam_user_api::SteamUserApi,
10};
11
12pub struct FallbackSteamUser {
20 pub local: SteamUser,
21 #[cfg(feature = "remote")]
22 pub remote: Option<RemoteSteamUser>,
23 #[cfg(feature = "gas")]
24 pub gas: Option<GasSteamUser>,
25}
26
27impl FallbackSteamUser {
28 pub fn new(local: SteamUser) -> Self {
29 Self {
30 local,
31 #[cfg(feature = "remote")]
32 remote: None,
33 #[cfg(feature = "gas")]
34 gas: None,
35 }
36 }
37
38 #[cfg(feature = "remote")]
39 pub fn with_remote(mut self, remote: RemoteSteamUser) -> Self {
40 self.remote = Some(remote);
41 self
42 }
43
44 #[cfg(feature = "gas")]
45 pub fn with_gas(mut self, gas: GasSteamUser) -> Self {
46 self.gas = Some(gas);
47 self
48 }
49}
50
51for_each_api_method!(gen_fallback_impl);