Skip to main content

Crate thincan

Crate thincan 

Source
Expand description

thincan: capnp-only message transport helpers over ISO-TP payloads.

thincan sits above ISO-TP and defines a tiny wire header:

  • u16 message id (little-endian)
  • message body bytes (Cap’n Proto single segment)

The crate provides:

  • bus_atlas! for message marker declarations
  • maplet! for composing a compile-time message set
  • bundle_instance! for generating bundle instance structs and BundleFactory impls
  • maplet-typed Interface for async send, ingest, and mailboxed typed receive

Macros§

bundle_instance
Generate a bundle instance wrapper struct and its BundleFactory implementation.
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.
CapnpTyped
A schema-typed Cap’n Proto decode helper that borrows a buffer.
Error
Error type returned by most thincan operations.
IngestOutcome
Result of ingesting a payload into a bus mailbox.
Interface
Maplet-typed shared interface containing transport send path and per-message receive mailboxes.
MessageSpec
Simple message metadata (id + body length).
NoopRawMutex
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.
RecvMeta
Receive metadata provided by transports that can identify the sender.
Unscoped
Marker for an unscoped handle that is limited to ingest-only operations.

Enums§

ErrorKind
Error classification returned by thincan operations.
IngestError
Error returned while ingesting payloads into a bus mailbox.
IngestPumpError
Error returned by integrated transport-ingest pump operations.
IngestPumpStatus
Result of one integrated transport-ingest pump step.

Constants§

HEADER_LEN
Number of bytes used for the message id header.

Traits§

BundleFactory
Factory hook used by maplet! to build singleton bundle instances.
BundleSpec
Marker for a bundle’s declared message set.
CapnpMessage
Marker trait for messages whose body is a Cap’n Proto single segment.
EncodeCapnp
A trait for values that can encode a Cap’n Proto body for transmission.
MapletHasBundle
Marker: maplet contains bundle B.
MapletSpec
Marker for a compile-time message set.
Message
Marker trait for message types declared in a bus atlas.
RawMutex
Raw mutex trait.
RxFlowControlConfig
Optional extension trait: configure ISO-TP receive-side FlowControl (BS/STmin).

Functions§

decode_wire
Decode a raw ISO-TP payload into a RawMessage.