pub struct Server<T: AsyncRead + AsyncWrite, C: Encoder + Decoder, I> { /* private fields */ }
Expand description

Server provides a generic base for building stream servers.

This is generic over T, a stream reader and writer, C, and encoder and decoder, and I, and information object.

You probably want to be looking at TcpServer and UnixServer implementations

Implementations§

Create a new base server with defined request and response message types.

This sets up internal resources however requires implementation to handle creating listeners and binding connections See TcpServer and UnixServer for examples

Take the incoming data handle.

You can then use for_each to iterate over received requests as in the examples

Bind a socket to a server.

This attaches an rx handler to the server, and can be used both for server listener implementations as well as to support server-initialised connections if required

Close the socket server

This sends exit messages to the main task and all connected hosts

TCP server implementation.

Unix server implementation

This binds to and listens on a unix domain socket

Trait Implementations§

Clone over generic connector

All instances of a given connector contain the same arc/mutex protected information

Returns a copy of the value. Read more
Performs copy-assignment from source. 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.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. 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.