Skip to main content

Module encoder

Module encoder 

Source
Expand description

Encoders that convert captured bus messages into canonical payload bytes.

Each registered encoder is responsible for two outputs:

  • The canonical payload bytes, written verbatim into the entry’s payload field. The reader pairs the bytes with crate::PayloadType to dispatch the matching decoder.
  • The sidecar IndexKeys the writer commits in the same backend transaction so forensics scans by client_order_id or venue_order_id resolve to a committed seq rather than missing entries the reader can observe before the indices catch up.

The trait is type-erased so the registry can lookup by std::any::TypeId; concrete encoders are typed via the TypedEncoder adapter and avoid downcasting at the call site.

Structs§

EncodedPayload
The canonical payload plus sidecar indices an encoder produces for one captured message.
TypedEncoder
A typed wrapper that adapts a Fn(&T) -> Result<EncodedPayload, EncodeError> to Encode.

Enums§

EncodeError
Errors returned by an Encode implementation.

Traits§

Encode
A type-erased encoder used by the registry.