Skip to main content

Crate ferripfs_blockstore

Crate ferripfs_blockstore 

Source
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.
CacheStats
Cache statistics
CachingBlockstore
Caching blockstore that wraps another blockstore with an LRU cache.
FlatFsBlockstore
FlatFS blockstore - stores blocks as files using sharding.
GcBlockstore
A blockstore wrapper that can block garbage collection.
GcGuard
Guard that blocks garbage collection.
GcWriteGuard
Guard held during garbage collection.

Enums§

BlockstoreError
Blockstore error type

Constants§

BLAKE2B_256_MULTIHASH
Multihash type for blake2b-256
BLAKE3_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.
BlockstoreViewer
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§

BlockstoreResult
Result type for blockstore operations