pub struct Client {
pub app_id: String,
pub client_key: String,
pub dashboard_hostname: String,
}
Expand description
TSAR Client. Used to interact with the TSAR API.
Fields§
§app_id: String
The ID of your TSAR app. Should be in UUID format: 00000000-0000-0000-0000-000000000000
client_key: String
The client decryption key for your TSAR app. Should be in base64 format. Always starts with “MFk…”
dashboard_hostname: String
The hostname of your app’s dashboard.
Implementations§
Source§impl Client
impl Client
Sourcepub fn get_hwid() -> Result<String, TsarError>
pub fn get_hwid() -> Result<String, TsarError>
Utility for getting a user’s HWID across all platforms.
Sourcepub fn create(options: ClientParams) -> Result<Self, TsarError>
pub fn create(options: ClientParams) -> Result<Self, TsarError>
Creates a new TSAR client.
Sourcepub fn authenticate(&self, options: AuthParams) -> Result<User, TsarError>
pub fn authenticate(&self, options: AuthParams) -> Result<User, TsarError>
Attempts to authenticate the user. If the user’s HWID is not authorized, the function opens the user’s default browser to prompt a login.
Sourcepub fn encrypted_api_call<T: DeserializeOwned>(
path: &str,
public_key: &str,
params: Vec<(&str, &str)>,
) -> Result<T, TsarError>
pub fn encrypted_api_call<T: DeserializeOwned>( path: &str, public_key: &str, params: Vec<(&str, &str)>, ) -> Result<T, TsarError>
Query an endpoint from the TSAR API.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
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