pub struct Document {
pub version: (u32, u32),
pub schema_versions: BTreeMap<String, SchemaVersion>,
pub aliases: BTreeMap<String, String>,
pub structs: BTreeMap<String, Vec<String>>,
pub nests: BTreeMap<String, Vec<String>>,
pub root: BTreeMap<String, Item>,
}Expand description
A parsed HEDL document.
Fields§
§version: (u32, u32)Version (major, minor).
schema_versions: BTreeMap<String, SchemaVersion>Schema versions for types used in this document (for schema evolution). Empty map means no schema versioning is used (legacy behavior).
aliases: BTreeMap<String, String>Alias definitions.
structs: BTreeMap<String, Vec<String>>Struct definitions (type -> columns).
nests: BTreeMap<String, Vec<String>>Nest relationships (parent -> children). A parent type can have multiple child types.
root: BTreeMap<String, Item>Root body content.
Implementations§
Source§impl Document
impl Document
Sourcepub fn get_schema_version(&self, type_name: &str) -> Option<SchemaVersion>
pub fn get_schema_version(&self, type_name: &str) -> Option<SchemaVersion>
Get schema version for a type.
Sourcepub fn set_schema_version(&mut self, type_name: String, version: SchemaVersion)
pub fn set_schema_version(&mut self, type_name: String, version: SchemaVersion)
Set schema version for a type.
Sourcepub fn get_schema(&self, type_name: &str) -> Option<&Vec<String>>
pub fn get_schema(&self, type_name: &str) -> Option<&Vec<String>>
Get a struct schema by type name.
Sourcepub fn get_child_types(&self, parent_type: &str) -> Option<&Vec<String>>
pub fn get_child_types(&self, parent_type: &str) -> Option<&Vec<String>>
Get the child types for a parent type (from NEST). A parent type can have multiple child types (e.g., Customer > Address, Customer > Order).
Sourcepub fn expand_alias(&self, key: &str) -> Option<&String>
pub fn expand_alias(&self, key: &str) -> Option<&String>
Expand an alias key to its value.
Trait Implementations§
impl StructuralPartialEq for Document
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more