Struct tsar_client::Client
source · pub struct Client {
pub app_id: String,
pub client_key: String,
}Expand description
The TSAR Client struct. Used to interact with the API after it’s initialized.
Fields§
§app_id: StringThe ID of your TSAR app. Should be in UUID format: 00000000-0000-0000-0000-000000000000
client_key: StringThe public decryption key for your TSAR app. Should be in base64 format.
Implementations§
source§impl Client
impl Client
sourcepub fn new(app_id: &str, client_key: &str) -> Self
pub fn new(app_id: &str, client_key: &str) -> Self
Creates a new TSAR client using an app_id and client_key variables.
sourcepub fn authenticate_user(&self) -> Result<Data, AuthError>
pub fn authenticate_user(&self) -> Result<Data, AuthError>
Starts an authentication flow which attempts to authenticate the user. If the user’s HWID is not already authorized, the function opens the user’s default browser to authenticate them.
sourcepub fn validate_user(&self, hwid: &str) -> Result<Data, ValidateError>
pub fn validate_user(&self, hwid: &str) -> Result<Data, ValidateError>
Check if a HWID is authorized to use the application.
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