pub enum AuthorizationState {
Closed(AuthorizationStateClosed),
Closing(AuthorizationStateClosing),
LoggingOut(AuthorizationStateLoggingOut),
Ready(AuthorizationStateReady),
WaitCode(AuthorizationStateWaitCode),
WaitEncryptionKey(AuthorizationStateWaitEncryptionKey),
WaitOtherDeviceConfirmation(AuthorizationStateWaitOtherDeviceConfirmation),
WaitPassword(AuthorizationStateWaitPassword),
WaitPhoneNumber(AuthorizationStateWaitPhoneNumber),
WaitRegistration(AuthorizationStateWaitRegistration),
WaitTdlibParameters(AuthorizationStateWaitTdlibParameters),
GetAuthorizationState(GetAuthorizationState),
// some variants omitted
}
Expand description
Represents the current authorization state of the TDLib client
Variants
Closed(AuthorizationStateClosed)
Tuple Fields
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
Closing(AuthorizationStateClosing)
Tuple Fields
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
LoggingOut(AuthorizationStateLoggingOut)
Tuple Fields
The user is currently logging out
Ready(AuthorizationStateReady)
Tuple Fields
The user has been successfully authorized. TDLib is now ready to answer queries
WaitCode(AuthorizationStateWaitCode)
Tuple Fields
TDLib needs the user’s authentication code to authorize
WaitEncryptionKey(AuthorizationStateWaitEncryptionKey)
Tuple Fields
TDLib needs an encryption key to decrypt the local database
WaitOtherDeviceConfirmation(AuthorizationStateWaitOtherDeviceConfirmation)
Tuple Fields
The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link
WaitPassword(AuthorizationStateWaitPassword)
Tuple Fields
The user has been authorized, but needs to enter a password to start using the application
WaitPhoneNumber(AuthorizationStateWaitPhoneNumber)
Tuple Fields
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
WaitRegistration(AuthorizationStateWaitRegistration)
Tuple Fields
The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration
WaitTdlibParameters(AuthorizationStateWaitTdlibParameters)
Tuple Fields
TDLib needs TdlibParameters for initialization
GetAuthorizationState(GetAuthorizationState)
Tuple Fields
Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state. Can be called before initialization
Implementations
pub fn on_wait_encryption_key<F: FnOnce(&AuthorizationStateWaitEncryptionKey)>(
&self,
fnc: F
) -> &Self
pub fn on_wait_other_device_confirmation<F: FnOnce(&AuthorizationStateWaitOtherDeviceConfirmation)>(
&self,
fnc: F
) -> &Self
pub fn on_wait_phone_number<F: FnOnce(&AuthorizationStateWaitPhoneNumber)>(
&self,
fnc: F
) -> &Self
pub fn on_wait_registration<F: FnOnce(&AuthorizationStateWaitRegistration)>(
&self,
fnc: F
) -> &Self
pub fn on_wait_tdlib_parameters<F: FnOnce(&AuthorizationStateWaitTdlibParameters)>(
&self,
fnc: F
) -> &Self
pub fn as_wait_other_device_confirmation(
&self
) -> Option<&AuthorizationStateWaitOtherDeviceConfirmation>
pub fn wait_other_device_confirmation<T: AsRef<AuthorizationStateWaitOtherDeviceConfirmation>>(
t: T
) -> Self
Trait Implementations
Performs the conversion.
fn deserialize<D>(deserializer: D) -> Result<AuthorizationState, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<AuthorizationState, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for AuthorizationState
impl Send for AuthorizationState
impl Sync for AuthorizationState
impl Unpin for AuthorizationState
impl UnwindSafe for AuthorizationState
Blanket Implementations
Mutably borrows from an owned value. Read more