pub struct PendingAuth {
pub request: AuthRequest,
}Expand description
Handle for a pending authentication interrupt.
Wraps an AuthRequest and provides ergonomic resolution methods.
§Example
match driver.next().await? {
LoopStep::Interrupt(LoopInterrupt::AuthRequest(pending)) => {
println!("Auth required from: {}", pending.request.provider);
pending.cancel(driver)?;
}
_ => {}
}Fields§
§request: AuthRequestThe underlying auth request details.
Implementations§
Source§impl PendingAuth
impl PendingAuth
Sourcepub fn provide<S: ModelSession>(
self,
driver: &mut LoopDriver<S>,
credentials: MetadataMap,
) -> Result<(), LoopError>
pub fn provide<S: ModelSession>( self, driver: &mut LoopDriver<S>, credentials: MetadataMap, ) -> Result<(), LoopError>
Provide credentials to satisfy the auth request.
Sourcepub fn cancel<S: ModelSession>(
self,
driver: &mut LoopDriver<S>,
) -> Result<(), LoopError>
pub fn cancel<S: ModelSession>( self, driver: &mut LoopDriver<S>, ) -> Result<(), LoopError>
Cancel the auth flow.
Methods from Deref<Target = AuthRequest>§
Sourcepub fn server_id(&self) -> Option<&str>
pub fn server_id(&self) -> Option<&str>
Convenience accessor that delegates to AuthOperation::server_id.
Trait Implementations§
Source§impl Clone for PendingAuth
impl Clone for PendingAuth
Source§fn clone(&self) -> PendingAuth
fn clone(&self) -> PendingAuth
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 moreSource§impl Debug for PendingAuth
impl Debug for PendingAuth
Source§impl Deref for PendingAuth
impl Deref for PendingAuth
Source§type Target = AuthRequest
type Target = AuthRequest
The resulting type after dereferencing.
Source§fn deref(&self) -> &AuthRequest
fn deref(&self) -> &AuthRequest
Dereferences the value.
Source§impl<'de> Deserialize<'de> for PendingAuth
impl<'de> Deserialize<'de> for PendingAuth
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PendingAuth
impl PartialEq for PendingAuth
Source§impl Serialize for PendingAuth
impl Serialize for PendingAuth
impl Eq for PendingAuth
impl StructuralPartialEq for PendingAuth
Auto Trait Implementations§
impl Freeze for PendingAuth
impl RefUnwindSafe for PendingAuth
impl Send for PendingAuth
impl Sync for PendingAuth
impl Unpin for PendingAuth
impl UnsafeUnpin for PendingAuth
impl UnwindSafe for PendingAuth
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