typedb_driver::concept

Enum 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

source

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

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

pub fn get_category(&self) -> ConceptCategory

Get the category of this concept

source

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()
source

pub fn is_entity_type(&self) -> bool

Check if this concept represents an Entity Type from the schema of the database

source

pub fn is_relation_type(&self) -> bool

Check if this concept represents a Relation Type from the schema of the database

source

pub fn is_role_type(&self) -> bool

Check if this concept represents a Role Type from the schema of the database

source

pub fn is_attribute_type(&self) -> bool

Check if this concept represents an Attribute Type from the schema of the database

source

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()
source

pub fn is_entity(&self) -> bool

Check if this concept represents an Entity instance from the database

source

pub fn is_relation(&self) -> bool

Check if this concept represents an Relation instance from the database

source

pub fn is_attribute(&self) -> bool

Check if this concept represents an Attribute instance from the database

source

pub fn is_value(&self) -> bool

Check if this concept represents a Value returned by the database

source

pub fn is_boolean(&self) -> bool

Check if this concept holds a boolean, either in an Attribute or as a Value

source

pub fn is_long(&self) -> bool

Check if this concept holds a long, either in an Attribute or as a Value

source

pub fn is_decimal(&self) -> bool

Check if this concept holds a fixed-decimal, either in an Attribute or as a Value

source

pub fn is_double(&self) -> bool

Check if this concept holds a double, either in an Attribute or as a Value

source

pub fn is_string(&self) -> bool

Check if this concept holds a string, either in an Attribute or as a Value

source

pub fn is_date(&self) -> bool

Check if this concept holds a date, either in an Attribute or as a Value

source

pub fn is_datetime(&self) -> bool

Check if this concept holds a datetime, either in an Attribute or as a Value

source

pub fn is_datetime_tz(&self) -> bool

Check if this concept holds a timezoned-datetime, either in an Attribute or as a Value

source

pub fn is_duration(&self) -> bool

Check if this concept holds a duration, either in an Attribute or as a Value

Trait Implementations§

source§

impl Clone for Concept

source§

fn clone(&self) -> Concept

Returns a copy of the value. Read more
1.6.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Concept

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Concept

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Concept

source§

fn eq(&self, other: &Concept) -> bool

Tests for self and other values to be equal, and is used by ==.
1.6.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Concept

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromRef<T> for T
where T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
source§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more