Lfan-ke/raft-moonbit/storage does not have a README file
pub(open) trait RaftStorage {
fn initial_state(Self) -> HardState
fn storage_entries(Self, UInt64, UInt64, UInt64) -> Array[Entry] raise StorageError
fn storage_term(Self, UInt64) -> UInt64 raise StorageError
fn first_index(Self) -> UInt64
fn last_index(Self) -> UInt64
fn storage_snapshot(Self) -> Snapshot raise StorageError
fn append(Self, Array[Entry]) -> Unit
}pub(all) suberror StorageError {
Compacted
Unavailable
SnapOutOfDate
SnapshotTemporarilyUnavailable
} derive(Eq)impl RaftStorage for MemoryStoragefn storage_entries(self : MemoryStorage, lo : UInt64, hi : UInt64, max_size : UInt64) -> Array[Entry] raise StorageErrorfn MemoryStorage::apply_snapshot(self : MemoryStorage, snapshot : Snapshot) -> Unit raise StorageErrorfn MemoryStorage::create_snapshot(self : MemoryStorage, index : UInt64, data : Bytes, conf_state? : ConfState?) -> Snapshot raise StorageErrorRaft consensus algorithm implemented in MoonBit.