pub struct PendingHandshake { /* private fields */ }Expand description
In-flight handshake. Returned by loopback_handshake before the
caller decides how to surface the URL.
Drop this without calling PendingHandshake::wait to abandon the
flow; the listener closes when the value goes out of scope.
Implementations§
Source§impl PendingHandshake
impl PendingHandshake
Sourcepub fn url(&self) -> &str
pub fn url(&self) -> &str
The URL to open in the user’s browser. Hand this to whatever
“open external URL” facility the consumer has — webbrowser::open,
shell.openExternal, or println!.
Sourcepub fn state(&self) -> &str
pub fn state(&self) -> &str
The CSRF state we generated. Mostly useful for tests / debugging; callers don’t normally need to look at it.
Sourcepub async fn wait(self) -> Result<HandshakeOutcome>
pub async fn wait(self) -> Result<HandshakeOutcome>
Block (on a worker thread) until the browser redirects back, or the timeout fires.
Auto Trait Implementations§
impl Freeze for PendingHandshake
impl RefUnwindSafe for PendingHandshake
impl Send for PendingHandshake
impl Sync for PendingHandshake
impl Unpin for PendingHandshake
impl UnsafeUnpin for PendingHandshake
impl UnwindSafe for PendingHandshake
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