Crate streambed_codec

Crate streambed_codec 

Source
Expand description

§Codec

This crate provides a trait Codec and two (initial) implementations, Cbor and CborEncrypted.
A Codec value is a convenient abstraction over the lower level serialisation and crypto functions in streambed.

A Codec is also closely associated with a CommitLog and a Topic since values stored on the commit log under a given topic will all be encoded the same way.

The type LogAdapter is provided to wrap a Codec, CommitLog and Topic. A LogAdapter carries a type parameter for the decoded log values. It can be viewed as a typed counterpart to CommitLog

The produce method on LogAdapter accepts a typed value, encodes it and appends it to the log.
The history method returns a Stream of typed values from the commit log.

Structs§

Cbor
A Codec for CBOR
CborEncrypted
A Codec for encripted CBOR
LogAdapter
Wraps a CommitLog and specializes it for a specific payload type. This adds the type, topic and the encoding and encryption scheme.

Enums§

ProducerError
There was a problem producing a record

Traits§

Codec
A trait for codecs for a specic type A, usually an event type stored on a CommitLog.
CommitLog
A commit log holds topics and can be appended to and tailed. Connections are managed and retried if they cannot be established.
CommitLogExt
Provides a method on CommitLog to specialize it for a payload type.