pub struct LoopbackFlow { /* private fields */ }Expand description
A started loopback flow: the authorization URL to open plus the capture server waiting on an ephemeral loopback port.
Implementations§
Source§impl LoopbackFlow
impl LoopbackFlow
Sourcepub fn start(
authorize_url: &str,
client_id: &str,
scopes: &[String],
login_hint: Option<&str>,
timeout: Duration,
) -> Result<Self, LoopbackError>
pub fn start( authorize_url: &str, client_id: &str, scopes: &[String], login_hint: Option<&str>, timeout: Duration, ) -> Result<Self, LoopbackError>
Binds an ephemeral loopback port and builds the authorization URL.
§Errors
LoopbackError::Bind if the loopback listener cannot bind.
Sourcepub fn start_for_provider(
provider: &MailProvider,
login_hint: Option<&str>,
timeout: Duration,
) -> Result<Self, LoopbackError>
pub fn start_for_provider( provider: &MailProvider, login_hint: Option<&str>, timeout: Duration, ) -> Result<Self, LoopbackError>
Convenience wrapper binding a flow for a [MailProvider] preset.
§Errors
LoopbackError::Bind if the loopback listener cannot bind.
The full authorization URL for the user’s browser.
Sourcepub fn wait_for_code(self) -> Result<CapturedCode, LoopbackError>
pub fn wait_for_code(self) -> Result<CapturedCode, LoopbackError>
Waits for exactly one redirect, validates the single-use state,
serves a confirmation page, and shuts the listener down.
Consumes self: after this returns (ok or err) the port is closed
and a second redirect is refused.
§Errors
LoopbackError variants for timeout, provider error, state
mismatch, missing code, or I/O failure.
Auto Trait Implementations§
impl Freeze for LoopbackFlow
impl RefUnwindSafe for LoopbackFlow
impl Send for LoopbackFlow
impl Sync for LoopbackFlow
impl Unpin for LoopbackFlow
impl UnsafeUnpin for LoopbackFlow
impl UnwindSafe for LoopbackFlow
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