Skip to main content

Module server

Module server 

Source
Expand description

ChatServer and ChatListener traits for server-side implementations, plus the concrete protocol-agnostic Server.

A server is a named container of listeners. It owns no address, port, or protocol of its own — those belong to the listeners. Different listeners may speak entirely different protocols (e.g. IRC on one port, WebSocket on another) while still feeding messages into the same server event loop.

A listener is a single (protocol, address, port) combination. It handles all wire-protocol details: accepting connections, parsing inbound data into Messages, calling the message handler, and formatting replies back in the appropriate wire format.

Structs§

Server
The standard, protocol-agnostic ChatServer implementation.

Traits§

ChatListener
A single network endpoint: one (protocol, address, port) combination.
ChatServer
A protocol-agnostic chat server.

Functions§

into_handler
Wrap a generic async closure into a MessageHandler.

Type Aliases§

MessageHandler
A type-erased, cloneable, async message handler.