pub struct Server<L = HttpListener> { /* private fields */ }
Expand description

A server can listen on a TCP socket.

Once listening, it will create a Request/Response pair for each incoming connection, and hand them to the provided handler.

Implementations

Creates a new server with the provided handler.

Controls keep-alive for this server.

The timeout duration passed will be used to determine how long to keep the connection alive before dropping it.

Passing None will disable keep-alive.

Default is enabled with a 5 second timeout.

Sets the read timeout for all Request reads.

Sets the write timeout for all Response writes.

Get the address that the server is listening on.

Creates a new server that will handle HttpStreams.

Creates a new server that will handle HttpStreams over SSL.

You can use any SSL implementation, as long as implements cogo_http::net::Ssl.

Binds to a socket and starts handling connections.

Binds to a socket and starts handling connections.

Binds to a socket and starts handling connections with the provided number of tasks on pool

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

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

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.