Struct tsukuyomi::server::Server

source ·
pub struct Server<S, M = Identity, L = SocketAddr, A = (), R = Runtime> { /* private fields */ }
Expand description

An HTTP server.

Implementations

Create a new Server with the specified NewService and default configuration.

Sets the transport used by the server.

By default, a TCP transport with the listener address "127.0.0.1:4000" is set.

Sets the instance of Acceptor to the server.

By default, the raw acceptor is set, which returns the incoming I/Os directly.

Sets the HTTP-level configuration to this server.

Note that the executor will be overwritten by the launcher.

Sets the middleware to this server.

Sets the instance of runtime to the specified runtime.

Switches the runtime to be used to current_thread::Runtime.

Convert itself into a TestServer.

Convert itself into a TestServer.

Trait Implementations

Formats the value using the given formatter. Read more

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.

Should always be Self
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.