| Crates.io | legalis-registry |
| lib.rs | legalis-registry |
| version | 0.1.3 |
| created_at | 2026-01-05 05:14:54.628376+00 |
| updated_at | 2026-01-21 03:43:06.714967+00 |
| description | Statute registry and version management for Legalis-RS |
| homepage | https://github.com/cool-japan/legalis |
| repository | https://github.com/cool-japan/legalis |
| max_upload_size | |
| id | 2023114 |
| size | 1,527,120 |
Statute registry and collection management for Legalis-RS.
legalis-registry provides an in-memory storage system for managing collections of legal statutes with versioning, tagging, and jurisdiction-based organization.
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)?;
| 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 |
MIT OR Apache-2.0