pub struct Loopback { /* private fields */ }target_family=wasm only.Expand description
Where a browser sign-in returns: the provider and app its pages name,
the host, the ports to try in order (0 lets the system pick one), and
the callback path.
Implementations§
Source§impl Loopback
impl Loopback
Sourcepub fn new(
provider: impl Into<String>,
host: LoopbackHost,
ports: impl IntoIterator<Item = u16>,
path: impl Into<String>,
) -> Self
pub fn new( provider: impl Into<String>, host: LoopbackHost, ports: impl IntoIterator<Item = u16>, path: impl Into<String>, ) -> Self
A listener for provider’s sign-in on host at the first free port
of ports, taking callbacks on path, such as /callback. Its
pages tell the user to return to rig until
Self::with_app_name says otherwise.
Sourcepub fn with_app_name(self, app: impl Into<String>) -> Self
pub fn with_app_name(self, app: impl Into<String>) -> Self
This listener’s pages telling the user to return to app.
Sourcepub fn listen(
&self,
state: String,
deadline: Instant,
) -> Result<Listener, LoopbackError>
pub fn listen( &self, state: String, deadline: Instant, ) -> Result<Listener, LoopbackError>
Binds the first free port and serves it on a thread of its own until
a callback with state arrives, deadline passes, or the returned
Listener is dropped, which the thread notices within a fraction
of a second. The port is freed when the thread ends.
§Errors
LoopbackError::Bind when no port could be bound, of kind
io::ErrorKind::AddrInUse when every one was taken, and
LoopbackError::Io when the thread cannot start.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Loopback
impl Freeze for Loopback
impl Move for Loopback
impl RefUnwindSafe for Loopback
impl Send for Loopback
impl Sync for Loopback
impl Unpin for Loopback
impl UnsafeUnpin for Loopback
impl UnwindSafe for Loopback
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more