5 releases
Uses new Rust 2024
| new 0.1.4 | Jan 29, 2026 |
|---|---|
| 0.1.3 | Jan 21, 2026 |
| 0.1.2 | Jan 16, 2026 |
| 0.1.1 | Jan 10, 2026 |
| 0.1.0 | Jan 5, 2026 |
#828 in Magic Beans
Used in 2 crates
2.5MB
55K
SLoC
legalis-registry
Statute registry and collection management for Legalis-RS.
Overview
legalis-registry provides an in-memory storage system for managing collections of legal statutes with versioning, tagging, and jurisdiction-based organization.
Features
- In-Memory Storage: Fast statute storage with full CRUD operations
- Versioning: Track multiple versions of the same statute
- Tag-Based Organization: Organize statutes with flexible tagging
- Jurisdiction Indexing: Quick lookup by jurisdiction
- Search: Find statutes by ID, tags, or jurisdiction
Usage
use legalis_registry::{StatuteRegistry, RegistryEntry};
use legalis_core::{Statute, Effect, EffectType};
// Create a registry
let mut registry = StatuteRegistry::new();
// Add a statute
let statute = Statute::new(
"adult-rights",
"Adult Rights",
Effect::new(EffectType::Grant, "Full legal capacity"),
);
registry.add(statute.clone())?;
// Query by jurisdiction
let us_statutes = registry.find_by_jurisdiction("US")?;
// Query by tag
let civil_statutes = registry.find_by_tag("civil-rights")?;
// Get specific version
let statute_v1 = registry.get_version("adult-rights", 1)?;
API
StatuteRegistry
| Method | Description |
|---|---|
new() |
Create empty registry |
add(statute) |
Add a statute |
get(id) |
Get latest version |
get_version(id, version) |
Get specific version |
find_by_jurisdiction(jurisdiction) |
Find by jurisdiction |
find_by_tag(tag) |
Find by tag |
list_all() |
List all statutes |
remove(id) |
Remove a statute |
License
MIT OR Apache-2.0
Dependencies
~5–30MB
~423K SLoC