Struct nickel::ListeningServer

source ·
pub struct ListeningServer(_);
Expand description

A server listeing on a socket

Implementations

Gets the SocketAddr which the server is currently listening on.

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

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Get the TypeId of this object.