pub struct ValidatorEntityType {
pub descendants: HashSet<Name>,
/* private fields */
}Expand description
Contains entity type information for use by the validator. The contents of
the struct are the same as the schema entity type structure, but the
member_of relation is reversed to instead be descendants.
Fields§
§descendants: HashSet<Name>The set of entity types that can be members of this entity type. When this structure is initially constructed, the field will contain direct children, but it will be updated to contain the closure of all descendants before it is used in any validation.
Implementations§
source§impl ValidatorEntityType
impl ValidatorEntityType
sourcepub fn attr(&self, attr: &str) -> Option<&AttributeType>
pub fn attr(&self, attr: &str) -> Option<&AttributeType>
Get the type of the attribute with the given name, if it exists
sourcepub fn attributes(&self) -> impl Iterator<Item = (&SmolStr, &AttributeType)>
pub fn attributes(&self) -> impl Iterator<Item = (&SmolStr, &AttributeType)>
An iterator over the attributes of this entity
sourcepub fn has_descendant_entity_type(&self, ety: &EntityType) -> bool
pub fn has_descendant_entity_type(&self, ety: &EntityType) -> bool
Return true if this entity type has an EntityType declared as a
possible descendant in the schema. This takes an EntityType rather
than a Name, It’s not possible to declare the unspecified entity type
is a descendant of an entity type in the schema, so we can return false
in the unspecified case.
Trait Implementations§
source§impl Clone for ValidatorEntityType
impl Clone for ValidatorEntityType
source§fn clone(&self) -> ValidatorEntityType
fn clone(&self) -> ValidatorEntityType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ValidatorEntityType
impl Debug for ValidatorEntityType
source§impl Serialize for ValidatorEntityType
impl Serialize for ValidatorEntityType
source§impl TCNode<Name> for ValidatorEntityType
impl TCNode<Name> for ValidatorEntityType
source§fn add_edge_to(&mut self, k: Name)
fn add_edge_to(&mut self, k: Name)
k.source§fn out_edges(&self) -> Box<dyn Iterator<Item = &Name> + '_>
fn out_edges(&self) -> Box<dyn Iterator<Item = &Name> + '_>
source§fn has_edge_to(&self, e: &Name) -> bool
fn has_edge_to(&self, e: &Name) -> bool
k.