pub trait ClientAuthStateHandler:
DynClone
+ Send
+ Sync
+ Debug {
// Required methods
fn handle_wait_code<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_code: &'life1 AuthorizationStateWaitCode,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn handle_encryption_key<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_encryption_key: &'life1 AuthorizationStateWaitEncryptionKey,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn handle_wait_password<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_password: &'life1 AuthorizationStateWaitPassword,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn handle_wait_client_identifier<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_phone_number: &'life1 AuthorizationStateWaitPhoneNumber,
) -> Pin<Box<dyn Future<Output = ClientIdentifier> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn handle_wait_registration<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_registration: &'life1 AuthorizationStateWaitRegistration,
) -> Pin<Box<dyn Future<Output = (String, String)> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn handle_other_device_confirmation<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_device_confirmation: &'life1 AuthorizationStateWaitOtherDeviceConfirmation,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}
Expand description
ClientAuthStateHandler
trait provides methods that returns data, required for authentication.
Mandatory to use AuthStateHandlerProxy if you want to handle authorization per-client, see See examples/auth_bot.rs
for details.
Required Methods§
Sourcefn handle_wait_code<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_code: &'life1 AuthorizationStateWaitCode,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_wait_code<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_code: &'life1 AuthorizationStateWaitCode,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns wait code
Sourcefn handle_encryption_key<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_encryption_key: &'life1 AuthorizationStateWaitEncryptionKey,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_encryption_key<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_encryption_key: &'life1 AuthorizationStateWaitEncryptionKey,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns database encryption key
Sourcefn handle_wait_password<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_password: &'life1 AuthorizationStateWaitPassword,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_wait_password<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_password: &'life1 AuthorizationStateWaitPassword,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns password
Sourcefn handle_wait_client_identifier<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_phone_number: &'life1 AuthorizationStateWaitPhoneNumber,
) -> Pin<Box<dyn Future<Output = ClientIdentifier> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_wait_client_identifier<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_phone_number: &'life1 AuthorizationStateWaitPhoneNumber,
) -> Pin<Box<dyn Future<Output = ClientIdentifier> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns ClientIdentifier
Sourcefn handle_wait_registration<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_registration: &'life1 AuthorizationStateWaitRegistration,
) -> Pin<Box<dyn Future<Output = (String, String)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_wait_registration<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_registration: &'life1 AuthorizationStateWaitRegistration,
) -> Pin<Box<dyn Future<Output = (String, String)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns first_name and second_name
Provided Methods§
Sourcefn handle_other_device_confirmation<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_device_confirmation: &'life1 AuthorizationStateWaitOtherDeviceConfirmation,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_other_device_confirmation<'life0, 'life1, 'async_trait>(
&'life0 self,
wait_device_confirmation: &'life1 AuthorizationStateWaitOtherDeviceConfirmation,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Interacts with provided link