pub struct ValidatorEntityType {
pub descendants: HashSet<EntityType>,
/* 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<EntityType>
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.
Trait Implementations§
source§impl Clone for ValidatorEntityType
impl Clone for ValidatorEntityType
source§fn clone(&self) -> ValidatorEntityType
fn clone(&self) -> ValidatorEntityType
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ValidatorEntityType
impl Debug for ValidatorEntityType
source§impl Serialize for ValidatorEntityType
impl Serialize for ValidatorEntityType
source§impl TCNode<EntityType> for ValidatorEntityType
impl TCNode<EntityType> for ValidatorEntityType
source§fn get_key(&self) -> EntityType
fn get_key(&self) -> EntityType
Extract a unique identifier for the node.
source§fn add_edge_to(&mut self, k: EntityType)
fn add_edge_to(&mut self, k: EntityType)
Add an edge out off this node to the node with key
k
.source§fn out_edges(&self) -> Box<dyn Iterator<Item = &EntityType> + '_>
fn out_edges(&self) -> Box<dyn Iterator<Item = &EntityType> + '_>
Retrieve an iterator for the edges out of this node.
source§fn has_edge_to(&self, e: &EntityType) -> bool
fn has_edge_to(&self, e: &EntityType) -> bool
Return true when their is an edge between this node and the node with
key
k
.Auto Trait Implementations§
impl Freeze for ValidatorEntityType
impl RefUnwindSafe for ValidatorEntityType
impl Send for ValidatorEntityType
impl Sync for ValidatorEntityType
impl Unpin for ValidatorEntityType
impl UnwindSafe for ValidatorEntityType
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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