Crates.io | streambed-codec |
lib.rs | streambed-codec |
version | 0.12.0 |
source | src |
created_at | 2024-11-27 08:04:02.307425 |
updated_at | 2024-11-27 08:04:02.307425 |
description | Codecs and a typed wrapped for streambed CommitLog |
homepage | |
repository | https://github.com/streambed/streambed-rs.git |
max_upload_size | |
id | 1462760 |
size | 10,373 |
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.