Expand description
Utilities to support producing streams of blocks, as well as converting streams of blocks to and from CARv1-encoded byte streams
Structs§
- Block
Ledger - A utility to help with tracking the relationship of blocks and references within a series of blocks.
Functions§
- from_
car_ stream - Takes a Bytes stream and interprets it as a
CARv1, returning a stream of
(Cid, Vec<u8>)blocks. - memo_
body_ stream - Stream all the blocks required to read the sphere at a given version (making no assumptions of what historical data may already be available to the reader).
- memo_
history_ stream - Stream all the blocks required to reconstruct the history of a sphere since a given point in time (or else the beginning of the history).
- put_
block_ stream - Helper to put blocks from a Stream into any implementor of BlockStore
- record_
stream_ orphans - Wraps a block stream (any stream yielding
Result<(Cid, Vec<u8>)>), and records “orphan” blocks to a providede target buffer. - to_
car_ stream - Takes a list of roots and a stream of blocks (pairs of Cid and
corresponding Vec
), and produces an async byte stream that yields a valid CARv1 - walk_
versioned_ map_ changes_ and - Given a VersionedMap and BlockStore, visit the VersionedMap’s changelog; then, invoke the provided callback with each entry associated with an ‘add’ operation in the changelog
- walk_
versioned_ map_ elements - Given a VersionedMap, visit its changelog and all of its underlying entries
- walk_
versioned_ map_ elements_ and - Given a VersionedMap and BlockStore, visit the VersionedMap’s changelog and all of its underlying entries, invoking a callback for each entry