pub struct DeviceAuthorizationOptions {
pub expires_in: Duration,
pub interval: Duration,
pub device_code_length: usize,
pub user_code_length: usize,
pub generate_device_code: Option<Arc<dyn Fn() -> Pin<Box<dyn Future<Output = String> + Send>> + Send + Sync>>,
pub generate_user_code: Option<Arc<dyn Fn() -> Pin<Box<dyn Future<Output = String> + Send>> + Send + Sync>>,
pub validate_client: Option<Arc<dyn Fn(String) -> Pin<Box<dyn Future<Output = Result<bool, OpenAuthError>> + Send>> + Send + Sync>>,
pub on_device_auth_request: Option<Arc<dyn Fn(String, Option<String>) -> Pin<Box<dyn Future<Output = Result<(), OpenAuthError>> + Send>> + Send + Sync>>,
pub verification_uri: String,
pub schema: DeviceAuthorizationSchemaOptions,
}Fields§
§expires_in: Duration§interval: Duration§device_code_length: usize§user_code_length: usize§generate_device_code: Option<Arc<dyn Fn() -> Pin<Box<dyn Future<Output = String> + Send>> + Send + Sync>>§generate_user_code: Option<Arc<dyn Fn() -> Pin<Box<dyn Future<Output = String> + Send>> + Send + Sync>>§validate_client: Option<Arc<dyn Fn(String) -> Pin<Box<dyn Future<Output = Result<bool, OpenAuthError>> + Send>> + Send + Sync>>§on_device_auth_request: Option<Arc<dyn Fn(String, Option<String>) -> Pin<Box<dyn Future<Output = Result<(), OpenAuthError>> + Send>> + Send + Sync>>§verification_uri: String§schema: DeviceAuthorizationSchemaOptionsImplementations§
Source§impl DeviceAuthorizationOptions
impl DeviceAuthorizationOptions
pub fn new() -> Self
pub fn validate(&self) -> Result<(), DeviceAuthorizationOptionsError>
pub fn expires_in(self, expires_in: Duration) -> Self
pub fn interval(self, interval: Duration) -> Self
pub fn device_code_length(self, length: usize) -> Self
pub fn user_code_length(self, length: usize) -> Self
pub fn generate_device_code<F>(self, generator: F) -> Self
pub fn generate_user_code<F>(self, generator: F) -> Self
pub fn generate_device_code_async<F, Fut>(self, generator: F) -> Self
pub fn generate_user_code_async<F, Fut>(self, generator: F) -> Self
pub fn validate_client<F, Fut>(self, validator: F) -> Self
pub fn on_device_auth_request<F, Fut>(self, hook: F) -> Self
pub fn verification_uri(self, uri: impl Into<String>) -> Self
pub fn schema(self, schema: DeviceAuthorizationSchemaOptions) -> Self
Trait Implementations§
Source§impl Clone for DeviceAuthorizationOptions
impl Clone for DeviceAuthorizationOptions
Source§fn clone(&self) -> DeviceAuthorizationOptions
fn clone(&self) -> DeviceAuthorizationOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DeviceAuthorizationOptions
impl !RefUnwindSafe for DeviceAuthorizationOptions
impl Send for DeviceAuthorizationOptions
impl Sync for DeviceAuthorizationOptions
impl Unpin for DeviceAuthorizationOptions
impl UnsafeUnpin for DeviceAuthorizationOptions
impl !UnwindSafe for DeviceAuthorizationOptions
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