Expand description
General-purpose network server.
Use build() or ServerBuilder to register TCP or Unix domain socket
services. Each worker receives its own service instance and processes
connections on a single-threaded runtime.
Re-exports§
pub use crate::NoConfig;pub use crate::ServerAppConfig;
Structs§
- Accept
Loop - Accept loop for network listeners.
- Accept
Notify - Handle for sending commands to the accept loop.
- Connection
- Accepted connection dispatched to a worker.
- Server
Builder - Builder for a network server.
- Service
Config - Listener and worker configuration used by
ServerBuilder::configure. - Service
Runtime - Per-worker runtime used to attach services to named listeners.
- Stream
Server - Worker configuration for network servers.
- Test
Server - Test server controller.
- Test
Server Builder - Builder for a single-worker test server.
- Token
- Identifier assigned to a registered listener.
Enums§
- Acceptor
Command - Command sent to the accept loop.
- Server
Status - Server readiness status.
- Stream
- Accepted socket stream.
Functions§
- bind_
addr - Binds TCP listeners for every address resolved from
addr. - build
- Creates a server builder with no application configuration.
- build_
test_ server - Starts a test server configured by a server builder.
- build_
with_ config - Creates a server builder with application configuration.
- create_
tcp_ listener - Creates and binds a TCP listener with the specified listen backlog.
- test_
server - Starts a test server for the specified service factory.
Type Aliases§
- Server
- Controller for a running network server.