Module server

Source
Expand description

Definitions of a postcard-rpc Server

The Server role is responsible for accepting endpoint requests, issuing endpoint responses, receiving client topic messages, and sending server topic messages

§Impls

It is intended to allow postcard-rpc servers to be implemented for many different transport types, as well as many different operating environments.

Examples of impls include:

  • A no-std impl using embassy and embassy-usb to provide transport over USB
  • A std impl using Tokio channels to provide transport for testing

Impls are expected to implement three traits:

  • WireTx: how the server sends frames to the client
  • WireRx: how the server receives frames from the client
  • WireSpawn: how the server spawns worker tasks for certain handlers

Modules§

impls
Implementations of various Server traits

Structs§

Sender
The Sender type wraps a WireTx impl, and provides higher level functionality over it
Server
The Server is the main interface for handling communication

Enums§

ServerError
A type representing the different errors Server::run() may return
WireRxErrorKind
The base WireRx Error Kind
WireTxErrorKind
The base WireTx Error Kind

Traits§

AsWireRxErrorKind
A conversion trait to convert a user error into a base Kind type
AsWireTxErrorKind
A conversion trait to convert a user error into a base Kind type
Dispatch
The dispatch trait handles an incoming endpoint or topic message
SpawnContext
A conversion trait for taking the Context and making a SpawnContext
WireRx
This trait defines how to receive a single frame from a client
WireSpawn
A trait to assist in spawning a handler task
WireTx
This trait defines how the server sends frames to the client

Functions§

min_key_needed
Calculates at const time the minimum number of bytes (1, 2, 4, or 8) to avoid hash collisions in the lists of keys provided.