InMemoryBlockStore class

A simple in-memory block store implementation.

This is intended for testing, ephemeral caching, and lightweight applications. It does not persist data across process restarts.

Implemented types

Constructors

InMemoryBlockStore()
Creates an empty in-memory block store.

Properties

hashCode int
The hash code for this object.
no setterinherited
length int
Returns the number of blocks currently in memory.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
Clears all blocks from the store.
getAllBlocks() Future<List<Block>>
Returns all stored blocks.
override
getBlock(CID cid) Future<BlockStoreResult<Block?>>
Retrieves a block by its CID.
override
hasBlock(CID cid) Future<bool>
Returns true if the block exists.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
putBlock(Block block) Future<BlockStoreResult<void>>
Stores a block.
override
removeBlock(CID cid) Future<BlockStoreResult<bool>>
Removes a block by its CID.
override
start() Future<void>
Starts the block store.
override
stop() Future<void>
Stops the block store and releases resources.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited