pub struct DeviceFlow { /* private fields */ }
Expand description
Main device flow implementation
Implementations§
Source§impl DeviceFlow
impl DeviceFlow
Sourcepub fn new(provider: Provider, config: DeviceFlowConfig) -> Result<Self>
pub fn new(provider: Provider, config: DeviceFlowConfig) -> Result<Self>
Create a new device flow instance
Sourcepub async fn initialize(&mut self) -> Result<&AuthorizationResponse>
pub async fn initialize(&mut self) -> Result<&AuthorizationResponse>
Initialize the device authorization flow
Sourcepub async fn poll_for_token(&self) -> Result<TokenResponse>
pub async fn poll_for_token(&self) -> Result<TokenResponse>
Poll for the token
Sourcepub async fn run(&mut self) -> Result<TokenManager>
pub async fn run(&mut self) -> Result<TokenManager>
Run the complete device flow and return a token manager
Get the current authorization response
Sourcepub fn config(&self) -> &DeviceFlowConfig
pub fn config(&self) -> &DeviceFlowConfig
Get the configuration
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Check if the device flow has been initialized
Sourcepub fn with_provider(self, provider: Provider) -> Result<Self>
pub fn with_provider(self, provider: Provider) -> Result<Self>
Create a new device flow for a different provider with the same config
Sourcepub fn with_config(self, config: DeviceFlowConfig) -> Result<Self>
pub fn with_config(self, config: DeviceFlowConfig) -> Result<Self>
Update the configuration
Trait Implementations§
Source§impl Clone for DeviceFlow
impl Clone for DeviceFlow
Source§fn clone(&self) -> DeviceFlow
fn clone(&self) -> DeviceFlow
Returns a duplicate of the value. Read more
1.0.0 · 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 DeviceFlow
impl !RefUnwindSafe for DeviceFlow
impl Send for DeviceFlow
impl Sync for DeviceFlow
impl Unpin for DeviceFlow
impl !UnwindSafe for DeviceFlow
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