oxedyne/fe2o3/fe2o3_namex/src/lib.rs
1.3 KiB, 21 runs
created by r1870400018:523, which is this file's identity for as long as the history lasts, whatever it is later renamed to
download · who wrote it · its history
| 1 | //! A universal name codex system for distributed identifier management. |
| 2 | //! |
| 3 | //! Namex provides a decentralised approach to mapping 32-byte identifiers to named entities, |
| 4 | //! allowing consistent identification of schemes, formats, and other specifications across |
| 5 | //! distributed systems. The system supports: |
| 6 | //! |
| 7 | //! - Entity storage with rich metadata including names, descriptions and cross-references |
| 8 | //! - Multiple names per entity with language support |
| 9 | //! - Hierarchical tagging for flexible categorisation |
| 10 | //! - JDAT-based storage format with JSON export capability |
| 11 | //! - Distributed operation through file sharing and merging |
| 12 | //! |
| 13 | //! # Example |
| 14 | //! |
| 15 | //! ```no_run |
| 16 | //! use oxedyne_fe2o3_core::prelude::*; |
| 17 | //! use oxedyne_fe2o3_namex::{ |
| 18 | //! db::{Entity, MapKey, Namex}, |
| 19 | //! id::NamexId, |
| 20 | //! }; |
| 21 | //! use std::collections::BTreeMap; |
| 22 | //! |
| 23 | //! fn example() -> Outcome<()> { |
| 24 | //! // Load an existing namex database. |
| 25 | //! let namex = res!(Namex::< |
| 26 | //! BTreeMap<MapKey, Entity>, |
| 27 | //! BTreeMap<NamexId, Entity>, |
| 28 | //! >::load("namex.jdat")); |
| 29 | //! |
| 30 | //! // Export as JDAT or JSON. |
| 31 | //! let jdat_lines = res!(namex.export_jdat()); |
| 32 | //! res!(namex.to_file(jdat_lines, "export.jdat")); |
| 33 | //! |
| 34 | //! Ok(()) |
| 35 | //! } |
| 36 | //! ``` |
| 37 | //! |
| 38 | #![forbid(unsafe_code)] |
| 39 | pub mod db; |
| 40 | pub mod id; |
| 41 | |
| 42 | pub use id::InNamex; |