Enum typedb_driver::concept::Concept
source · 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 get_iid(&self) -> Option<&IID>
pub fn get_iid(&self) -> Option<&IID>
Get the IID of this concept, if it exists. If this is an Entity or Relation Instance, return the IID of the instance. Otherwise, return empty
sourcepub fn get_value_type(&self) -> Option<ValueType>
pub fn get_value_type(&self) -> Option<ValueType>
Get the value type enum of the concept, if it exists If this is an Attribute Instance, return the value type of the value of this instance. If this is a Value, return the value type of the value. If this is an Attribute Type, it returns value type that the schema permits for the attribute type, if one is defined. Otherwise, return empty.
sourcepub fn get_value(&self) -> Option<&Value>
pub fn get_value(&self) -> Option<&Value>
Get the value of this concept, if it exists. If this is an Attribute Instance, return the value of this instance. If this a Value, return the value. Otherwise, return empty.
sourcepub fn get_boolean(&self) -> Option<bool>
pub fn get_boolean(&self) -> Option<bool>
Get the boolean value of this concept, if it exists. If this is a boolean-valued Attribute Instance, return the boolean value of this instance. If this a boolean-valued Value, return the boolean value. Otherwise, return empty.
sourcepub fn get_long(&self) -> Option<i64>
pub fn get_long(&self) -> Option<i64>
Get the long value of this concept, if it exists. If this is a long-valued Attribute Instance, return the long value of this instance. If this a long-valued Value, return the long value. Otherwise, return empty.
sourcepub fn get_double(&self) -> Option<f64>
pub fn get_double(&self) -> Option<f64>
Get the double value of this concept, if it exists. If this is a double-valued Attribute Instance, return the double value of this instance. If this a double-valued Value, return the double value. Otherwise, return empty.
sourcepub fn get_decimal(&self) -> Option<Decimal>
pub fn get_decimal(&self) -> Option<Decimal>
Get the fixed-decimal value of this concept, if it exists. If this is a fixed-decimal valued Attribute Instance, return the fixed-decimal value of this instance. If this a fixed-decimal valued Value, return the fixed-decimal value. Otherwise, return empty.
sourcepub fn get_string(&self) -> Option<&str>
pub fn get_string(&self) -> Option<&str>
Get the string value of this concept, if it exists. If this is a string-valued Attribute Instance, return the string value of this instance. If this a string-valued Value, return the string value. Otherwise, return empty.
sourcepub fn get_date(&self) -> Option<NaiveDate>
pub fn get_date(&self) -> Option<NaiveDate>
Get the date value of this concept, if it exists. If this is a date-valued Attribute Instance, return the date value of this instance. If this a date-valued Value, return the date value. Otherwise, return empty.
sourcepub fn get_datetime(&self) -> Option<NaiveDateTime>
pub fn get_datetime(&self) -> Option<NaiveDateTime>
Get the datetime value of this concept, if it exists. If this is a datetime-valued Attribute Instance, return the datetime value of this instance. If this a datetime-valued Value, return the datetime value. Otherwise, return empty.
sourcepub fn get_datetime_tz(&self) -> Option<DateTime<Tz>>
pub fn get_datetime_tz(&self) -> Option<DateTime<Tz>>
Get the timezoned-datetime value of this concept, if it exists. If this is a timezoned-datetime valued Attribute Instance, return the timezoned-datetime value of this instance. If this a timezoned-datetime valued Value, return the timezoned-datetime value. Otherwise, return empty.
sourcepub fn get_duration(&self) -> Option<Duration>
pub fn get_duration(&self) -> Option<Duration>
Get the duration value of this concept, if it exists. If this is a duration-valued Attribute Instance, return the duration value of this instance. If this a duration-valued Value, return the duration value. Otherwise, return empty.
sourcepub fn get_category(&self) -> ConceptCategory
pub fn get_category(&self) -> ConceptCategory
Get 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, either in an Attribute or as a Value
sourcepub fn is_long(&self) -> bool
pub fn is_long(&self) -> bool
Check if this concept holds a long, either in an Attribute or as a Value
sourcepub fn is_decimal(&self) -> bool
pub fn is_decimal(&self) -> bool
Check if this concept holds a fixed-decimal, either in an Attribute or as a Value
sourcepub fn is_double(&self) -> bool
pub fn is_double(&self) -> bool
Check if this concept holds a double, either in an Attribute or as a Value
sourcepub fn is_string(&self) -> bool
pub fn is_string(&self) -> bool
Check if this concept holds a string, either in an Attribute or as a Value
sourcepub fn is_date(&self) -> bool
pub fn is_date(&self) -> bool
Check if this concept holds a date, either in an Attribute or as a Value
sourcepub fn is_datetime(&self) -> bool
pub fn is_datetime(&self) -> bool
Check if this concept holds a datetime, either in an Attribute or as a Value
sourcepub fn is_datetime_tz(&self) -> bool
pub fn is_datetime_tz(&self) -> bool
Check if this concept holds a timezoned-datetime, either in an Attribute or as a Value
sourcepub fn is_duration(&self) -> bool
pub fn is_duration(&self) -> bool
Check if this concept holds a duration, either in an Attribute or as 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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
source§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