Struct nickel::ListeningServer
source · pub struct ListeningServer(_);
Expand description
A server listeing on a socket
Implementations
sourceimpl ListeningServer
impl ListeningServer
sourcepub fn socket(&self) -> SocketAddr
pub fn socket(&self) -> SocketAddr
Gets the SocketAddr
which the server is currently listening on.
sourcepub fn detach(self)
pub fn detach(self)
Detaches the server thread.
This doesn’t actually kill the server, it just stops the current thread from
blocking due to the server running. In the case where main
returns due to
this unblocking, then the server will be killed due to process death.
The required use of this is when writing unit tests which spawn servers and do not want to block the test-runner by waiting on the server to stop because it probably never will.
See this hyper issue for more information.
Auto Trait Implementations
impl !RefUnwindSafe for ListeningServer
impl Send for ListeningServer
impl Sync for ListeningServer
impl Unpin for ListeningServer
impl !UnwindSafe for ListeningServer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more