Skip to main content

Module transport

Module transport 

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

PamojaMessage
An opaque handle to one message that arrived on a subscribed topic.
PamojaTransport
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.