pub enum Concept {
EntityType(EntityType),
RelationType(RelationType),
RoleType(RoleType),
AttributeType(AttributeType),
Entity(Entity),
Relation(Relation),
Attribute(Attribute),
Value(Value),
}
Expand description
The fundamental TypeQL object.
Variants§
EntityType(EntityType)
RelationType(RelationType)
RoleType(RoleType)
AttributeType(AttributeType)
Entity(Entity)
Relation(Relation)
Attribute(Attribute)
Value(Value)
Implementations§
Source§impl Concept
impl Concept
Sourcepub fn try_get_iid(&self) -> Option<&IID>
pub fn try_get_iid(&self) -> Option<&IID>
Retrieves the unique id (IID) of this Concept. If this is an Entity or Relation Instance, returns the IID of the instance. Otherwise, returns None.
Sourcepub fn get_label(&self) -> &str
pub fn get_label(&self) -> &str
Retrieves the label of this Concept. If this is an Instance, returns the label of the type of this instance (“unknown” if type fetching is disabled). If this is a Value, returns the label of the value type of the value. If this is a Type, returns the label of the type.
Sourcepub fn try_get_label(&self) -> Option<&str>
pub fn try_get_label(&self) -> Option<&str>
Retrieves the optional label of the concept. If this is an Instance, returns the label of the type of this instance (None if type fetching is disabled). If this is a Value, returns the label of the value type of the value. If this is a Type, returns the label of the type.
Sourcepub fn try_get_value_label(&self) -> Option<&str>
pub fn try_get_value_label(&self) -> Option<&str>
Retrieves the label of the value type of the concept, if it exists. If this is an Attribute Instance, returns the label of the value of this instance. If this is a Value, returns the label of the value. If this is an Attribute Type, returns the label of the value type that the schema permits for the attribute type, if one is defined. Otherwise, returns None.
Sourcepub fn try_get_value_type(&self) -> Option<ValueType>
pub fn try_get_value_type(&self) -> Option<ValueType>
Retrieves the value type enum of the concept, if it exists. If this is an Attribute Instance, returns the value type of the value of this instance. If this is a Value, returns the value type of the value. If this is an Attribute Type, returns value type that the schema permits for the attribute type, if one is defined. Otherwise, returns None.
Sourcepub fn try_get_value(&self) -> Option<&Value>
pub fn try_get_value(&self) -> Option<&Value>
Retrieves the value of this Concept, if it exists. If this is an Attribute Instance, returns the value of this instance. If this a Value, returns the value. Otherwise, returns empty.
Sourcepub fn try_get_boolean(&self) -> Option<bool>
pub fn try_get_boolean(&self) -> Option<bool>
Retrieves the boolean value of this Concept, if it exists. If this is a boolean-valued Attribute Instance, returns the boolean value of this instance. If this a boolean-valued Value, returns the boolean value. Otherwise, returns None.
Sourcepub fn try_get_integer(&self) -> Option<i64>
pub fn try_get_integer(&self) -> Option<i64>
Retrieves the integer value of this Concept, if it exists. If this is an integer-valued Attribute Instance, returns the integer value of this instance. If this an integer-valued Value, returns the integer value. Otherwise, returns None.
Sourcepub fn try_get_double(&self) -> Option<f64>
pub fn try_get_double(&self) -> Option<f64>
Retrieves the double value of this Concept, if it exists. If this is a double-valued Attribute Instance, returns the double value of this instance. If this a double-valued Value, returns the double value. Otherwise, returns None.
Sourcepub fn try_get_decimal(&self) -> Option<Decimal>
pub fn try_get_decimal(&self) -> Option<Decimal>
Retrieves the fixed-decimal value of this Concept, if it exists. If this is a fixed-decimal valued Attribute Instance, returns the fixed-decimal value of this instance. If this a fixed-decimal valued Value, returns the fixed-decimal value. Otherwise, returns None.
Sourcepub fn try_get_string(&self) -> Option<&str>
pub fn try_get_string(&self) -> Option<&str>
Retrieves the string value of this Concept, if it exists. If this is a string-valued Attribute Instance, returns the string value of this instance. If this a string-valued Value, returns the string value. Otherwise, returns None.
Sourcepub fn try_get_date(&self) -> Option<NaiveDate>
pub fn try_get_date(&self) -> Option<NaiveDate>
Retrieves the date value of this Concept, if it exists. If this is a date-valued Attribute Instance, returns the date value of this instance. If this a date-valued Value, returns the date value. Otherwise, returns None.
Sourcepub fn try_get_datetime(&self) -> Option<NaiveDateTime>
pub fn try_get_datetime(&self) -> Option<NaiveDateTime>
Retrieves the datetime value of this Concept, if it exists. If this is a datetime-valued Attribute Instance, returns the datetime value of this instance. If this a datetime-valued Value, returns the datetime value. Otherwise, returns None.
Sourcepub fn try_get_datetime_tz(&self) -> Option<DateTime<TimeZone>>
pub fn try_get_datetime_tz(&self) -> Option<DateTime<TimeZone>>
Retrieves the timezoned-datetime value of this Concept, if it exists. If this is a timezoned-datetime valued Attribute Instance, returns the timezoned-datetime value of this instance. If this a timezoned-datetime valued Value, returns the timezoned-datetime value. Otherwise, returns None.
Sourcepub fn try_get_duration(&self) -> Option<Duration>
pub fn try_get_duration(&self) -> Option<Duration>
Retrieves the duration value of this Concept, if it exists. If this is a duration-valued Attribute Instance, returns the duration value of this instance. If this a duration-valued Value, returns the duration value. Otherwise, returns None.
Sourcepub fn try_get_struct(&self) -> Option<&Struct>
pub fn try_get_struct(&self) -> Option<&Struct>
Retrieves the struct value of this Concept, if it exists. If this is a struct-valued Attribute Instance, returns the struct value of this instance. If this a struct-valued Value, returns the struct value. Otherwise, returns None.
Sourcepub fn get_category(&self) -> ConceptCategory
pub fn get_category(&self) -> ConceptCategory
Retrieves the category of this Concept.
Sourcepub fn is_type(&self) -> bool
pub fn is_type(&self) -> bool
Check if this Concept represents a Type from the schema of the database. These are exactly: Entity Types, Relation Types, Role Types, and Attribute Types
Equivalent to:
concept.is_entity_type() || concept.is_relation_type() || concept.is_role_type() || concept.is_attribute_type()
Sourcepub fn is_entity_type(&self) -> bool
pub fn is_entity_type(&self) -> bool
Check if this Concept represents an Entity Type from the schema of the database
Sourcepub fn is_relation_type(&self) -> bool
pub fn is_relation_type(&self) -> bool
Check if this Concept represents a Relation Type from the schema of the database
Sourcepub fn is_role_type(&self) -> bool
pub fn is_role_type(&self) -> bool
Check if this Concept represents a Role Type from the schema of the database
Sourcepub fn is_attribute_type(&self) -> bool
pub fn is_attribute_type(&self) -> bool
Check if this Concept represents an Attribute Type from the schema of the database
Sourcepub fn is_instance(&self) -> bool
pub fn is_instance(&self) -> bool
Check if this Concept represents a stored database instance from the database. These are exactly: Entity, Relation, and Attribute
Equivalent to:
concept.is_entity() || concept.is_relation() || concept.is_attribute()
Sourcepub fn is_entity(&self) -> bool
pub fn is_entity(&self) -> bool
Check if this Concept represents an Entity instance from the database
Sourcepub fn is_relation(&self) -> bool
pub fn is_relation(&self) -> bool
Check if this Concept represents an Relation instance from the database
Sourcepub fn is_attribute(&self) -> bool
pub fn is_attribute(&self) -> bool
Check if this Concept represents an Attribute instance from the database
Sourcepub fn is_value(&self) -> bool
pub fn is_value(&self) -> bool
Check if this Concept represents a Value returned by the database
Sourcepub fn is_boolean(&self) -> bool
pub fn is_boolean(&self) -> bool
Check if this Concept holds a boolean as an AttributeType, an Attribute, or a Value
Sourcepub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Check if this Concept holds an integer as an AttributeType, an Attribute, or a Value
Sourcepub fn is_decimal(&self) -> bool
pub fn is_decimal(&self) -> bool
Check if this Concept holds a fixed-decimal as an AttributeType, an Attribute, or a Value
Sourcepub fn is_double(&self) -> bool
pub fn is_double(&self) -> bool
Check if this Concept holds a double as an AttributeType, an Attribute, or a Value
Sourcepub fn is_string(&self) -> bool
pub fn is_string(&self) -> bool
Check if this Concept holds a string as an AttributeType, an Attribute, or a Value
Sourcepub fn is_date(&self) -> bool
pub fn is_date(&self) -> bool
Check if this Concept holds a date as an AttributeType, an Attribute, or a Value
Sourcepub fn is_datetime(&self) -> bool
pub fn is_datetime(&self) -> bool
Check if this Concept holds a datetime as an AttributeType, an Attribute, or a Value
Sourcepub fn is_datetime_tz(&self) -> bool
pub fn is_datetime_tz(&self) -> bool
Check if this Concept holds a timezoned-datetime as an AttributeType, an Attribute, or a Value
Sourcepub fn is_duration(&self) -> bool
pub fn is_duration(&self) -> bool
Check if this Concept holds a duration as an AttributeType, an Attribute, or a Value
Trait Implementations§
impl StructuralPartialEq for Concept
Auto Trait Implementations§
impl Freeze for Concept
impl RefUnwindSafe for Concept
impl Send for Concept
impl Sync for Concept
impl Unpin for Concept
impl UnwindSafe for Concept
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request