pub struct Interaction { /* private fields */ }Expand description
The channel between a running sign-in and the UI that serves it.
Implementations§
Source§impl Interaction
impl Interaction
Sourcepub fn new(
cancel: CancellationToken,
) -> (Interaction, UnboundedReceiver<AuthRequest>)
pub fn new( cancel: CancellationToken, ) -> (Interaction, UnboundedReceiver<AuthRequest>)
An interaction cancelled by cancel, with the receiver the UI reads.
Sourcepub fn cancel(&self) -> &CancellationToken
pub fn cancel(&self) -> &CancellationToken
Cancels the whole sign-in.
Sourcepub async fn prompt(&self, prompt: AuthPrompt) -> Result<String, AuthError>
pub async fn prompt(&self, prompt: AuthPrompt) -> Result<String, AuthError>
Asks the UI and waits for the answer.
Sourcepub async fn prompt_until(
&self,
prompt: AuthPrompt,
cancel: CancellationToken,
) -> Result<String, AuthError>
pub async fn prompt_until( &self, prompt: AuthPrompt, cancel: CancellationToken, ) -> Result<String, AuthError>
Asks the UI. cancel withdraws the question.
Trait Implementations§
Source§impl Clone for Interaction
impl Clone for Interaction
Auto Trait Implementations§
impl Freeze for Interaction
impl RefUnwindSafe for Interaction
impl Send for Interaction
impl Sync for Interaction
impl Unpin for Interaction
impl UnsafeUnpin for Interaction
impl UnwindSafe for Interaction
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