| Crates.io | hive-lite |
| lib.rs | hive-lite |
| version | 0.0.1 |
| created_at | 2026-01-25 17:53:08.500267+00 |
| updated_at | 2026-01-25 17:53:08.500267+00 |
| description | Lightweight CRDT primitives for resource-constrained HIVE nodes |
| homepage | https://app.radicle.xyz/nodes/seed.toph.so/rad:z4Bhrn1aB8T5vp6Vg42xxvAXx5TJx |
| repository | https://app.radicle.xyz/nodes/seed.toph.so/rad:z4Bhrn1aB8T5vp6Vg42xxvAXx5TJx |
| max_upload_size | |
| id | 2069182 |
| size | 60,944 |
Lightweight CRDT primitives for resource-constrained HIVE nodes.
hive-lite provides bounded, no_std-compatible data structures suitable for devices with limited memory (256KB RAM budget):
| Type | Purpose | Memory |
|---|---|---|
NodeId |
32-bit node identifier | 4 bytes |
CannedMessage |
Predefined message codes | 1 byte |
CannedMessageEvent |
Message with metadata | ~24 bytes |
CannedMessageStore |
LWW storage | ~6KB (256 entries) |
LwwRegister<T> |
Last-writer-wins register | sizeof(T) + 12 bytes |
GCounter |
Grow-only distributed counter | ~4 bytes per node |
use hive_lite::{NodeId, CannedMessage, CannedMessageEvent};
let my_node = NodeId::new(0x12345678);
let event = CannedMessageEvent::new(
CannedMessage::Ack,
my_node,
Some(NodeId::new(0xDEADBEEF)), // target
1706234567000, // timestamp ms
);
// Encode for transmission (22 bytes)
let bytes = event.encode();
assert_eq!(bytes[0], 0xAF); // CannedMessage marker
0x00-0x0F Acknowledgments ACK, WILCO, NEGATIVE, SAY AGAIN
0x10-0x1F Status CHECK IN, MOVING, HOLDING, ON STATION, RTB, COMPLETE
0x20-0x2F Alerts EMERGENCY, ALERT, ALL CLEAR, CONTACT, UNDER FIRE
0x30-0x3F Requests NEED EXTRACT, NEED SUPPORT, MEDIC, RESUPPLY
0xF0-0xFF Reserved Custom/application-specific
std (default): Standard library supportno_std: --no-default-features# Cargo.toml - embedded usage
[dependencies]
hive-lite = { version = "0.1", default-features = false }
# With std (default)
cargo build
# For embedded (no_std)
cargo build --no-default-features
# Run tests
cargo test
Apache-2.0
This project uses Radicle for collaboration.
# Clone
rad clone rad:z4Bhrn1aB8T5vp6Vg42xxvAXx5TJx
# Create a patch
git checkout -b feature/my-feature
git commit -m "feat: description"
git push rad HEAD:refs/patches -o patch.message="feat: My change"