Skip to main content

Module net

Module net 

Source
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§

AcceptLoop
Accept loop for network listeners.
AcceptNotify
Handle for sending commands to the accept loop.
Connection
Accepted connection dispatched to a worker.
ServerBuilder
Builder for a network server.
ServiceConfig
Listener and worker configuration used by ServerBuilder::configure.
ServiceRuntime
Per-worker runtime used to attach services to named listeners.
StreamServer
Worker configuration for network servers.
TestServer
Test server controller.
TestServerBuilder
Builder for a single-worker test server.
Token
Identifier assigned to a registered listener.

Enums§

AcceptorCommand
Command sent to the accept loop.
ServerStatus
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.