Expand description
The C ABI for composing transports.
A ladder rung, a fault injector, and a degraded link all take “some
transport”, which in Rust is any impl Transport. A C ABI has no generics,
so this module carries one tagged handle that holds whichever transport was
built and dispatches to it. One handle keeps the composing calls to a single
function each, rather than one per transport kind, and lets the set of kinds
grow without reshaping the surface.
A transport built here is separate from a client handle such as
PamojaMqttClient. A client is for driving
a link directly; a transport is for composition, and is consumed by whatever
it is composed into. Keeping them apart means nothing has to move out of a
live, shared handle.
Structs§
- Pamoja
Message - An opaque handle to one message that arrived on a subscribed topic.
- Pamoja
Transport - An opaque handle to one transport, ready to drive or to compose.
Functions§
- pamoja_
message_ ⚠free - Releases a message handle.
- pamoja_
message_ ⚠payload - Returns a pointer to a message payload.
- pamoja_
message_ ⚠payload_ len - Returns the length in bytes of a message payload.
- pamoja_
message_ ⚠topic - Returns the topic a message arrived on.
- pamoja_
transport_ ⚠connect - Connects a transport.
- pamoja_
transport_ ⚠degraded - Wraps a transport in a link that loses packets and goes down.
- pamoja_
transport_ ⚠faulty - Wraps a transport so a set number of its next sends fail.
- pamoja_
transport_ ⚠free - Releases a transport handle.
- pamoja_
transport_ ⚠mqtt - Creates an MQTT transport from broker settings.
- pamoja_
transport_ ⚠send - Sends a payload to a topic over a transport.
- pamoja_
transport_ ⚠subscribe - Subscribes a transport to a topic.