#commit-log #streambed #codec #streambed-codec

streambed-codec

Codecs and a typed wrapped for streambed CommitLog

2 unstable releases

new 0.13.0 Apr 11, 2025
0.12.0 Nov 27, 2024

#4 in #commit-log

Download history 5/week @ 2024-12-13 1/week @ 2025-01-03 4/week @ 2025-01-10 2/week @ 2025-01-31 1/week @ 2025-02-07 8/week @ 2025-02-14 11/week @ 2025-02-21

87 downloads per month
Used in edfsm-machine

Apache-2.0

41KB
728 lines

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.

Dependencies

~6–13MB
~162K SLoC