pub struct Server<T> { /* private fields */ }Expand description
A running loopback server. Dropping it closes the listener and every open connection.
Implementations§
Source§impl<T: Send + 'static> Server<T>
impl<T: Send + 'static> Server<T>
Sourcepub async fn start(
host: &str,
port: u16,
path: &str,
cancel: &CancellationToken,
handler: Handler<T>,
) -> Result<Server<T>>
pub async fn start( host: &str, port: u16, path: &str, cancel: &CancellationToken, handler: Handler<T>, ) -> Result<Server<T>>
Listens on host:port (0 picks a port) and answers each request with
handler, until a reply has an outcome.
Sourcepub fn redirect_uri(&self) -> &str
pub fn redirect_uri(&self) -> &str
http://<host>:<port><path>, with the port the listener bound.
Sourcepub async fn wait(&mut self) -> Result<T, AuthError>
pub async fn wait(&mut self) -> Result<T, AuthError>
The outcome of the first conclusive request.
Sourcepub async fn wait_pending(
&mut self,
) -> Result<(T, Option<PendingPage>), AuthError>
pub async fn wait_pending( &mut self, ) -> Result<(T, Option<PendingPage>), AuthError>
Server::wait, with the page a pending server holds until the
sign-in finishes.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Server<T>
impl<T> !UnwindSafe for Server<T>
impl<T> Forget for Server<T>
impl<T> Freeze for Server<T>
impl<T> Send for Server<T>
impl<T> Sync for Server<T>
impl<T> Unpin for Server<T>
impl<T> UnsafeUnpin for Server<T>
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