Expand description
Blockstore implementation for ferripfs, ported from Kubo’s boxo/blockstore.
This module provides:
- Block type representing data with a CID
- CID utilities for creating and parsing content identifiers
- Blockstore trait for block storage operations
- FlatFS-backed blockstore implementation
- Caching blockstore wrapper
Structs§
- Block
- A block of data with an associated CID.
- Cache
Stats - Cache statistics
- Caching
Blockstore - Caching blockstore that wraps another blockstore with an LRU cache.
- Flat
FsBlockstore - FlatFS blockstore - stores blocks as files using sharding.
- GcBlockstore
- A blockstore wrapper that can block garbage collection.
- GcGuard
- Guard that blocks garbage collection.
- GcWrite
Guard - Guard held during garbage collection.
Enums§
- Blockstore
Error - Blockstore error type
Constants§
- BLAK
E2B_ 256_ MULTIHASH - Multihash type for blake2b-256
- BLAK
E3_ MULTIHASH - Multihash type for blake3
- DAG_
CBOR_ CODEC - Codec for dag-cbor
- DAG_
JSON_ CODEC - Codec for dag-json
- DAG_
PB_ CODEC - Codec for dag-pb (protobuf DAG)
- DEFAULT_
CACHE_ SIZE - Default cache size in number of blocks
- DEFAULT_
MULTIHASH - Default multihash type (sha2-256)
- RAW_
CODEC - Codec for raw data
- SHA2_
512_ MULTIHASH - Multihash type for sha2-512
- SHA3_
256_ MULTIHASH - Multihash type for sha3-256
Traits§
- Blockstore
- Blockstore provides block storage operations.
- Blockstore
Viewer - Viewer provides read-only access to the blockstore.
Functions§
- codec_
from_ name - Get the codec code from its name.
- codec_
name - Get the codec name from its code.
- compute_
multihash - Compute a multihash from data using the specified hash type.
- create_
cid_ v0 - Create a CIDv0 from data (sha2-256, dag-pb codec).
- create_
cid_ v1 - Create a CIDv1 from data with the specified multihash type.
- create_
cid_ v1_ with_ codec - Create a CIDv1 from data with the specified codec and multihash type.
- is_
cid_ v0 - Check if a CID is version 0.
- is_
cid_ v1 - Check if a CID is version 1.
- multihash_
code_ from_ name - Get the multihash code from its name.
- multihash_
type_ name - Get the multihash type name from its code.
- parse_
cid - Parse a CID string into a Cid.
- to_
cid_ v1 - Convert a CIDv0 to CIDv1.
Type Aliases§
- Blockstore
Result - Result type for blockstore operations