Commitlog
Append-only commit log library for Rust
Install / Use
/learn @zowens/CommitlogREADME
Commit Log
Sequential, disk-backed commit log library for Rust. The library can be used in various higher-level distributed abstractions on top of a distributed log such as Paxos, Chain Replication or Raft.
Usage
First, add this to your Cargo.toml:
[dependencies]
commitlog = "0.2"
use commitlog::*;
use commitlog::message::*;
fn main() {
// open a directory called 'log' for segment and index storage
let opts = LogOptions::new("log");
let mut log = CommitLog::new(opts).unwrap();
// append to the log
log.append_msg("hello world").unwrap(); // offset 0
log.append_msg("second message").unwrap(); // offset 1
// read the messages
let messages = log.read(0, ReadLimit::default()).unwrap();
for msg in messages.iter() {
println!("{} - {}", msg.offset(), String::from_utf8_lossy(msg.payload()));
}
// prints:
// 0 - hello world
// 1 - second message
}
Prior Art
Related Skills
himalaya
345.4kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
coding-agent
345.4kDelegate coding tasks to Codex, Claude Code, or Pi agents via background process
notion
345.4kNotion API for creating and managing pages, databases, and blocks.
tavily
345.4kTavily web search, content extraction, and research tools.
