pub struct SFAccount { /* private fields */ }
Implementations§
Source§impl SFAccount
impl SFAccount
Sourcepub async fn login(
username: String,
password: String,
) -> Result<SFAccount, SFError>
pub async fn login( username: String, password: String, ) -> Result<SFAccount, SFError>
Initializes a SFAccount
by logging the user in using the supplied
clear text credentials
§Errors
May return basically every possible SFError
variant, because we are
both sending a command and parsing the result
Sourcepub async fn login_with_options(
username: String,
password: String,
options: ConnectionOptions,
) -> Result<SFAccount, SFError>
pub async fn login_with_options( username: String, password: String, options: ConnectionOptions, ) -> Result<SFAccount, SFError>
Initializes a SFAccount
by logging the user in using the supplied
clear text credentials and the provided options to use for the
communication with the server
§Errors
May return basically every possible SFError
variant, because we are
both sending a command and parsing the result
Sourcepub async fn login_hashed(
username: String,
pw_hash: PWHash,
) -> Result<SFAccount, SFError>
pub async fn login_hashed( username: String, pw_hash: PWHash, ) -> Result<SFAccount, SFError>
Initializes a SFAccount
by logging the user in using the hashed
password
§Errors
May return basically every possible SFError
variant, because we are
both sending a command and parsing the result
Sourcepub async fn login_hashed_with_options(
username: String,
pw_hash: PWHash,
options: ConnectionOptions,
) -> Result<SFAccount, SFError>
pub async fn login_hashed_with_options( username: String, pw_hash: PWHash, options: ConnectionOptions, ) -> Result<SFAccount, SFError>
Initializes a SFAccount
by logging the user in using the hashed
password and the provided options to use for communication
§Errors
May return basically every possible SFError
variant, because we are
both sending a command and parsing the result
Sourcepub async fn refresh_login(&mut self) -> Result<(), SFError>
pub async fn refresh_login(&mut self) -> Result<(), SFError>
Refreshes the SSO session by logging in again with the stored credentials. This can be used when the server removed our session either for being connected too long, or the server was restarted/cache cleared and forgot us
§Errors
InvalidRequest
if you call this with anything else then a SSO/SF
account character. Even Google/Steam accounts will not work.
Sourcepub async fn characters(self) -> Result<Vec<Result<Session, SFError>>, SFError>
pub async fn characters(self) -> Result<Vec<Result<Session, SFError>>, SFError>
Queries the SSO for all characters associated with this account. This consumes the Account, as the character sessions may need to refresh the accounts session, which they are only allowed to do, if they own it (in an Arc<Mutex<_>>) and there should be no need to keep the account around anyways
§Errors
May return ParsingError
if the server changed it’s API, or
ConnectionError
, if the server could not be reached. The characters
in the Vec may be InvalidRequest
, iff the server the server the
character would be on could not be determined