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 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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn get_category(&self) -> ConceptCategory

Retrieves 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 as an AttributeType, an Attribute, or a Value

Source

pub fn is_integer(&self) -> bool

Check if this Concept holds an integer as an AttributeType, an Attribute, or a Value

Source

pub fn is_decimal(&self) -> bool

Check if this Concept holds a fixed-decimal as an AttributeType, an Attribute, or a Value

Source

pub fn is_double(&self) -> bool

Check if this Concept holds a double as an AttributeType, an Attribute, or a Value

Source

pub fn is_string(&self) -> bool

Check if this Concept holds a string as an AttributeType, an Attribute, or a Value

Source

pub fn is_date(&self) -> bool

Check if this Concept holds a date as an AttributeType, an Attribute, or a Value

Source

pub fn is_datetime(&self) -> bool

Check if this Concept holds a datetime as an AttributeType, an Attribute, or a Value

Source

pub fn is_datetime_tz(&self) -> bool

Check if this Concept holds a timezoned-datetime as an AttributeType, an Attribute, or a Value

Source

pub fn is_duration(&self) -> bool

Check if this Concept holds a duration as an AttributeType, an Attribute, or a Value

Source

pub fn is_struct(&self) -> bool

Check if this Concept holds a struct as an AttributeType, an Attribute, or a Value

Trait Implementations§

Source§

impl Clone for Concept

Source§

fn clone(&self) -> Concept

Returns a copy of the value. Read more
1.0.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.0.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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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§

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