# Rust Development

> Guidelines for Rust development in the ApexStore project — build commands, code conventions, LSM-tree architecture, and project structure. Use when this capability is needed.

- Skill: `tomevault-io/rust-development-2` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/rust-development-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/rust-development-2/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/rust-development-2

---


# Rust Development Skill

## Build & Test Commands

```bash
cargo build --release          # production build
cargo test --all-features       # run all tests
cargo clippy --all-targets --all-features -- -D warnings  # lint
cargo fmt --all -- --check      # formatting check
cargo doc --no-deps --all-features  # documentation
cargo audit                     # security audit
cargo bench                     # benchmarks
```

## Project Structure

- `src/lib.rs` — library root, re-exports
- `src/core/` — storage engine (memtable, sstable, compaction, WAL, block_cache, merge_iterator, column_family)
- `src/api/` — HTTP API (actix-web routes, handlers, models)
- `src/cli/` — CLI interface (clap)
- `src/tui/` — Terminal UI (ratatui)
- `benches/` — Criterion benchmarks
- `tests/` — Integration tests

## Code Conventions

- `thiserror` for library errors, `anyhow` for binaries
- `?` operator for error propagation (never `unwrap()` in production)
- Explicit lifetimes when needed, not by default
- Unit tests in same file with `#[cfg(test)]`
- Integration tests in `tests/` directory

## LSM-Tree Architecture

- Writes → Memtable (WAL + skiplist) → flush → SSTable L0
- Compaction merges SSTables across levels
- Bloom filters accelerate point reads
- Block cache (LRU) caches deserialized data blocks
- MergeIterator merges multiple sorted iterators

---
> Source: [ElioNeto/ApexStore](https://github.com/ElioNeto/ApexStore) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-16 -->

