pub struct Server { /* private fields */ }Expand description
Server side: a bound listener that dispatches each request to a handler.
Implementations§
Source§impl Server
impl Server
Sourcepub fn serve<F>(self, handler: F) -> Result<()>
pub fn serve<F>(self, handler: F) -> Result<()>
Serve connections sequentially, calling handler for each request.
Sourcepub fn serve_until<F, S>(self, handler: F, stop: S) -> Result<()>
pub fn serve_until<F, S>(self, handler: F, stop: S) -> Result<()>
Serve connections until stop() returns true (checked after each one).
Lets a handler request its own shutdown (e.g. an authenticated Shutdown).
Auto Trait Implementations§
impl !Freeze for Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Server
impl UnwindSafe for Server
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