Expand description
thincan: capnp-only message transport helpers over ISO-TP payloads.
thincan sits above ISO-TP and defines a tiny wire header:
u16message id (little-endian)- message body bytes (Cap’n Proto single segment)
The crate provides:
bus_atlas!for message marker declarationsmaplet!for composing a compile-time message setbundle_instance!for generating bundle instance structs andBundleFactoryimpls- maplet-typed
Interfacefor async send, ingest, and mailboxed typed receive
Macros§
- bundle_
instance - Generate a bundle instance wrapper struct and its
BundleFactoryimplementation. - bus_
atlas - Define a bus atlas: a registry of message ids and names.
- maplet
- Define a maplet by composing message bundles.
Structs§
- BusHandle
- Cloneable async protocol handle that borrows a shared
Interface. - Capnp
- A convenient wrapper for Cap’n Proto decode helpers that borrow a buffer.
- Capnp
Typed - A schema-typed Cap’n Proto decode helper that borrows a buffer.
- Error
- Error type returned by most
thincanoperations. - Ingest
Outcome - Result of ingesting a payload into a bus mailbox.
- Interface
- Maplet-typed shared interface containing transport send path and per-message receive mailboxes.
- Message
Spec - Simple message metadata (id + body length).
- Noop
RawMutex - A mutex that allows borrowing data in the context of a single executor.
- RawMessage
- A raw message as received on the wire (already framed/deframed at the ISO-TP layer).
- Received
- Typed received message payload returned by protocol receive helpers.
- Recv
Meta - Receive metadata provided by transports that can identify the sender.
- Unscoped
- Marker for an unscoped handle that is limited to ingest-only operations.
Enums§
- Error
Kind - Error classification returned by
thincanoperations. - Ingest
Error - Error returned while ingesting payloads into a bus mailbox.
- Ingest
Pump Error - Error returned by integrated transport-ingest pump operations.
- Ingest
Pump Status - Result of one integrated transport-ingest pump step.
Constants§
- HEADER_
LEN - Number of bytes used for the message id header.
Traits§
- Bundle
Factory - Factory hook used by
maplet!to build singleton bundle instances. - Bundle
Spec - Marker for a bundle’s declared message set.
- Capnp
Message - Marker trait for messages whose body is a Cap’n Proto single segment.
- Encode
Capnp - A trait for values that can encode a Cap’n Proto body for transmission.
- Maplet
HasBundle - Marker: maplet contains bundle
B. - Maplet
Spec - Marker for a compile-time message set.
- Message
- Marker trait for message types declared in a bus atlas.
- RawMutex
- Raw mutex trait.
- RxFlow
Control Config - Optional extension trait: configure ISO-TP receive-side FlowControl (BS/STmin).
Functions§
- decode_
wire - Decode a raw ISO-TP payload into a
RawMessage.