Module lightws::role

source ·
Expand description

Markers.

Markers are used to apply different strategies to clients or servers.

For example, Endpoint<IO, Client>::connect is used to to open a connection, and returns Stream<IO, Client>; Endpoint<IO, Server> is used to accept a connection and returns Stream<IO, Server>.

Both client and server meet RoleHelper, which indicates frame head length (currently unused), and how to mask payload data. Only client meets ClientRole, and only server meets ServerRole.

Any type implements these traits will be treated as a client or server.

Structs

Traits