pub enum AuthorizationState {
WaitTdlibParameters,
WaitPhoneNumber,
WaitEmailAddress(AuthorizationStateWaitEmailAddress),
WaitEmailCode(AuthorizationStateWaitEmailCode),
WaitCode(AuthorizationStateWaitCode),
WaitOtherDeviceConfirmation(AuthorizationStateWaitOtherDeviceConfirmation),
WaitRegistration(AuthorizationStateWaitRegistration),
WaitPassword(AuthorizationStateWaitPassword),
Ready,
LoggingOut,
Closing,
Closed,
}
Variants§
WaitTdlibParameters
Initialization parameters are needed. Call setTdlibParameters to provide them
WaitPhoneNumber
TDLib needs the user’s phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options
WaitEmailAddress(AuthorizationStateWaitEmailAddress)
TDLib needs the user’s email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed
WaitEmailCode(AuthorizationStateWaitEmailCode)
TDLib needs the user’s authentication code sent to an email address to authorize. Call checkAuthenticationEmailCode to provide the code
WaitCode(AuthorizationStateWaitCode)
TDLib needs the user’s authentication code to authorize. Call checkAuthenticationCode to check the code
WaitOtherDeviceConfirmation(AuthorizationStateWaitOtherDeviceConfirmation)
The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link
WaitRegistration(AuthorizationStateWaitRegistration)
The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration. Call registerUser to accept the terms of service and provide the data
WaitPassword(AuthorizationStateWaitPassword)
The user has been authorized, but needs to enter a 2-step verification password to start using the application. Call checkAuthenticationPassword to provide the password, or requestAuthenticationPasswordRecovery to recover the password, or deleteAccount to delete the account after a week
Ready
The user has been successfully authorized. TDLib is now ready to answer general requests
LoggingOut
The user is currently logging out
Closing
TDLib is closing, all subsequent queries will be answered with the error 500. Note that closing TDLib can take a while. All resources will be freed only after authorizationStateClosed has been received
Closed
TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to with error code 500. To continue working, one must create a new instance of the TDLib client
Trait Implementations§
Source§impl Clone for AuthorizationState
impl Clone for AuthorizationState
Source§fn clone(&self) -> AuthorizationState
fn clone(&self) -> AuthorizationState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more