TypeDB 3.0 is live! Get started for free.

Rust driver API reference

Connection

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/connection/Connection.adoc[]

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/connection/Credential.adoc[]

DatabaseManager

Implements traits:

  • Debug

Provides access to all database management methods.

all

  • async

  • sync

pub async fn all(&self) -> Result<Vec<Arc<Database>>>
pub fn all(&self) -> Result<Vec<Arc<Database>>>

Retrieves all databases present on the TypeDB server

Returns
Result<Vec<Arc<Database>>>
Code examples
  • async

  • sync

driver.databases().all().await;
driver.databases().all();

contains

  • async

  • sync

pub async fn contains(&self, name: impl Into<String>) -> Result<bool>
pub fn contains(&self, name: impl Into<String>) -> Result<bool>

Checks if a database with the given name exists

Input parameters
Name Description Type

name

— The database name to be checked

impl Into<String>

Returns
Result<bool>
Code examples
  • async

  • sync

driver.databases().contains(name).await;
driver.databases().contains(name);

create

  • async

  • sync

pub async fn create(&self, name: impl Into<String>) -> Result
pub fn create(&self, name: impl Into<String>) -> Result

Create a database with the given name

Input parameters
Name Description Type

name

— The name of the database to be created

impl Into<String>

Returns
Result
Code examples
  • async

  • sync

driver.databases().create(name).await;
driver.databases().create(name);

get

  • async

  • sync

pub async fn get(&self, name: impl AsRef<str>) -> Result<Arc<Database>>
pub fn get(&self, name: impl AsRef<str>) -> Result<Arc<Database>>

Retrieve the database with the given name.

Input parameters
Name Description Type

name

— The name of the database to retrieve

impl AsRef<str>

Returns
Result<Arc<Database>>
Code examples
  • async

  • sync

driver.databases().get(name).await;
driver.databases().get(name);

Database

Implements traits:

  • Debug

A TypeDB database

delete

  • async

  • sync

pub async fn delete(self: Arc<Self>) -> Result
pub fn delete(self: Arc<Self>) -> Result

Deletes this database.

Returns
Result
Code examples
  • async

  • sync

database.delete().await;
database.delete();

name

pub fn name(&self) -> &str

Retrieves the database name as a string.

Returns
&str

preferred_replica_info

pub fn preferred_replica_info(&self) -> Option<ReplicaInfo>

Returns the preferred replica for this database. Operations which can be run on any replica will prefer to use this replica. Only works in TypeDB Cloud / Enterprise

Returns
Option<ReplicaInfo>
Code examples
database.preferred_replica_info();

primary_replica_info

pub fn primary_replica_info(&self) -> Option<ReplicaInfo>

Returns the primary replica for this database. Only works in TypeDB Cloud / Enterprise

Returns
Option<ReplicaInfo>
Code examples
database.primary_replica_info()

replicas_info

pub fn replicas_info(&self) -> Vec<ReplicaInfo>

Returns the Replica instances for this database. Only works in TypeDB Cloud / Enterprise

Returns
Vec<ReplicaInfo>
Code examples
database.replicas_info()

schema

  • async

  • sync

pub async fn schema(&self) -> Result<String>
pub fn schema(&self) -> Result<String>

Returns a full schema text as a valid TypeQL define query string.

Returns
Result<String>
Code examples
  • async

  • sync

database.schema().await;
database.schema();

type_schema

  • async

  • sync

pub async fn type_schema(&self) -> Result<String>
pub fn type_schema(&self) -> Result<String>

Returns the types in the schema as a valid TypeQL define query string.

Returns
Result<String>
Code examples
  • async

  • sync

database.type_schema().await;
database.type_schema();

ReplicaInfo

Implements traits:

  • Debug

The metadata and state of an individual raft replica of a database.

Fields
Name Type Description

is_preferred

bool

Whether this is the preferred replica of the raft cluster. If true, Operations which can be run on any replica will prefer to use this replica.

is_primary

bool

Whether this is the primary replica of the raft cluster.

server

Address

The server hosting this replica

term

i64

The raft protocol ‘term’ of this replica.

UserManager

Implements traits:

  • Debug

Provides access to all user management methods.

all

  • async

  • sync

pub async fn all(&self) -> Result<Vec<User>>
pub fn all(&self) -> Result<Vec<User>>

Retrieves all users which exist on the TypeDB server.

Returns
Result<Vec<User>>
Code examples
driver.users.all().await;

contains

  • async

  • sync

pub async fn contains(&self, username: impl Into<String>) -> Result<bool>
pub fn contains(&self, username: impl Into<String>) -> Result<bool>

Checks if a user with the given name exists.

Input parameters
Name Description Type

username

— The user name to be checked

impl Into<String>

Returns
Result<bool>
Code examples
driver.users.contains(username).await;

create

  • async

  • sync

pub async fn create(
    &self,
    username: impl Into<String>,
    password: impl Into<String>,
) -> Result
pub fn create(
    &self,
    username: impl Into<String>,
    password: impl Into<String>,
) -> Result

Create a user with the given name & password.

Input parameters
Name Description Type

username

— The name of the user to be created

impl Into<String>

password

— The password of the user to be created

impl Into<String>

Returns
Result
Code examples
driver.users.create(username, password).await;

get

  • async

  • sync

pub async fn get(&self, username: impl Into<String>) -> Result<Option<User>>
pub fn get(&self, username: impl Into<String>) -> Result<Option<User>>

Retrieve a user with the given name.

Input parameters
Name Description Type

username

— The name of the user to retrieve

impl Into<String>

Returns
Result<Option<User>>
Code examples
driver.users.get(username).await;

User

Implements traits:

  • Clone

  • Debug

Fields
Name Type Description

name

String

password

Option<String>

server_connections

HashMap<Address, ServerConnection>

delete

  • async

  • sync

pub async fn delete(self) -> Result
pub fn delete(self) -> Result

Deletes this user

Input parameters
Name Description Type

username

— The name of the user to be deleted

Returns
Result
Code examples
  • async

  • sync

user.delete().await;
user.delete(username).await;
user.delete();
user.delete(username).await;

update_password

  • async

  • sync

pub async fn update_password(&self, password: impl Into<String>) -> Result<()>
pub fn update_password(&self, password: impl Into<String>) -> Result<()>

Update the user’s password.

Input parameters
Name Description Type

username

— The name of the user

password

— The new password

impl Into<String>) → Result<(

Returns
Result<()>
Code examples
  • async

  • sync

user.update_password(username, password).await;
user.update_password(username, password).await;
user.update_password(username, password);
user.update_password(username, password).await;

Session

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/session/Session.adoc[]

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/session/SessionType.adoc[]

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/session/Options.adoc[]

Transaction

Transaction

Implements traits:

  • Debug

A transaction with a TypeDB database.

commit

pub fn commit(self) -> impl Promise<'static, Result>

Commits the changes made via this transaction to the TypeDB database. Whether or not the transaction is commited successfully, it gets closed after the commit call.

Returns
impl Promise<'static, Result>
Code examples
  • async

  • sync

transaction.commit().await
transaction.commit()

force_close

pub fn force_close(&self)

Closes the transaction.

Returns
null
Code examples
transaction.force_close()

is_open

pub fn is_open(&self) -> bool

Closes the transaction.

Returns
bool
Code examples
transaction.close()

on_close

pub fn on_close(
    &self,
    callback: impl FnOnce(Option<Error>) + Send + Sync + 'static,
)

Registers a callback function which will be executed when this transaction is closed.

Input parameters
Name Description Type

function

— The callback function.

Returns
null
Code examples
transaction.on_close(function)

query

pub fn query(
    &self,
    query: impl AsRef<str>,
) -> impl Promise<'static, Result<QueryAnswer>>

Performs a TypeQL query with default options. See Transaction::query_with_options

Returns
impl Promise<'static, Result<QueryAnswer>>

query_with_options

pub fn query_with_options(
    &self,
    query: impl AsRef<str>,
    options: Options,
) -> impl Promise<'static, Result<QueryAnswer>>

Performs a TypeQL query in this transaction.

Input parameters
Name Description Type

query

— The TypeQL query to be executed

impl AsRef<str>

options

— Query options

Options

Returns
impl Promise<'static, Result<QueryAnswer>>
Code examples
transaction.query_with_options(query, options)

rollback

pub fn rollback(&self) -> impl Promise<'_, Result>

Rolls back the uncommitted changes made via this transaction.

Returns
impl Promise<'_, Result>
Code examples
  • async

  • sync

transaction.rollback().await
transaction.rollback()

type_

pub fn type_(&self) -> TransactionType

Retrieves the transaction’s type (READ or WRITE).

Returns
TransactionType

TransactionType

This enum is used to specify the type of transaction.

Enum variants
Variant

Read = 0

Schema = 2

Write = 1

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/transaction/QueryManager.adoc[]

Answer

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/answer/ConceptMapGroup.adoc[]

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/answer/ConceptMap.adoc[]

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/answer/ValueGroup.adoc[]

JSON

Enum variants
Variant

Array(Vec<JSON>)

Boolean(bool)

Null

Number(f64)

Object(HashMap<Cow<'static, str>, JSON>)

String(Cow<'static, str>)

Trait Promise

  • async

  • sync

Async promise, an alias for Rust’s built-in Future. A BoxPromise is an alias for Rust’s built-in BoxFuture.

Examples
promise.await

A resolvable promise that can be resolved at a later time. a BoxPromise is in practical terms a Box<dyn Promise> and resolves with .resolve().

Examples
promise.resolve()

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/answer/Explainables.adoc[]

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/answer/Explainable.adoc[]

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/answer/Explanation.adoc[]

Concept

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/concept/ConceptManager.adoc[]

Concept

The fundamental TypeQL object.

Enum variants
Variant

Attribute(Attribute)

AttributeType(AttributeType)

Entity(Entity)

EntityType(EntityType)

Relation(Relation)

RelationType(RelationType)

RoleType(RoleType)

Value(Value)

get_category

pub fn get_category(&self) -> ConceptCategory

Retrieves the category of this Concept.

Returns
ConceptCategory

get_label

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.

Returns
&str

is_attribute

pub fn is_attribute(&self) -> bool

Check if this Concept represents an Attribute instance from the database

Returns
bool

is_attribute_type

pub fn is_attribute_type(&self) -> bool

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

Returns
bool

is_boolean

pub fn is_boolean(&self) -> bool

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

Returns
bool

is_date

pub fn is_date(&self) -> bool

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

Returns
bool

is_datetime

pub fn is_datetime(&self) -> bool

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

Returns
bool

is_datetime_tz

pub fn is_datetime_tz(&self) -> bool

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

Returns
bool

is_decimal

pub fn is_decimal(&self) -> bool

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

Returns
bool

is_double

pub fn is_double(&self) -> bool

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

Returns
bool

is_duration

pub fn is_duration(&self) -> bool

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

Returns
bool

is_entity

pub fn is_entity(&self) -> bool

Check if this Concept represents an Entity instance from the database

Returns
bool

is_entity_type

pub fn is_entity_type(&self) -> bool

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

Returns
bool

is_instance

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:

Returns
bool
Code examples
concept.is_entity() || concept.is_relation() ||  concept.is_attribute()

is_integer

pub fn is_integer(&self) -> bool

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

Returns
bool

is_relation

pub fn is_relation(&self) -> bool

Check if this Concept represents an Relation instance from the database

Returns
bool

is_relation_type

pub fn is_relation_type(&self) -> bool

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

Returns
bool

is_role_type

pub fn is_role_type(&self) -> bool

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

Returns
bool

is_string

pub fn is_string(&self) -> bool

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

Returns
bool

is_struct

pub fn is_struct(&self) -> bool

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

Returns
bool

is_type

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:

Returns
bool
Code examples
concept.is_entity_type() || concept.is_relation_type() || concept.is_role_type() || concept.is_attribute_type()

is_value

pub fn is_value(&self) -> bool

Check if this Concept represents a Value returned by the database

Returns
bool

try_get_boolean

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.

Returns
Option<bool>

try_get_date

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.

Returns
Option<NaiveDate>

try_get_datetime

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.

Returns
Option<NaiveDateTime>

try_get_datetime_tz

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.

Returns
Option<DateTime<TimeZone>>

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

Returns
Option<Decimal>

try_get_double

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.

Returns
Option<f64>

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

Returns
Option<Duration>

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

Returns
Option<&IID>

try_get_integer

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.

Returns
Option<i64>

try_get_label

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.

Returns
Option<&str>

try_get_string

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.

Returns
Option<&str>

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

Returns
Option<&Struct>

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

Returns
Option<&Value>

try_get_value_label

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.

Returns
Option<&str>

try_get_value_type

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.

Returns
Option<ValueType>

Schema

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/schema/RootThingType.adoc[]

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/schema/ThingType.adoc[]

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/schema/Trait_ThingTypeAPI.adoc[]

EntityType

Implements traits:

  • Clone

  • Debug

  • Display

  • Eq

  • PartialEq

  • StructuralPartialEq

Entity types represent the classification of independent objects in the data model of the business domain.

Fields
Name Type Description

label

String

label

pub fn label(&self) -> &str

Retrieves the unique label of the EntityType.

Returns
&str
Code examples
entity_type.label()

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/schema/Trait_EntityTypeAPI.adoc[]

RelationType

Implements traits:

  • Clone

  • Debug

  • Display

  • Eq

  • PartialEq

  • StructuralPartialEq

Relation types (or subtypes of the relation root type) represent relationships between types. Relation types have roles.

Other types can play roles in relations if it’s mentioned in their definition.

A relation type must specify at least one role.

Fields
Name Type Description

label

String

label

pub fn label(&self) -> &str

Retrieves the unique label of the RelationType.

Returns
&str
Code examples
relation_type.label()

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/schema/Trait_RelationTypeAPI.adoc[]

RoleType

Implements traits:

  • Clone

  • Debug

  • Display

  • Eq

  • PartialEq

  • StructuralPartialEq

Roles are special internal types used by relations. We can not create an instance of a role in a database. But we can set an instance of another type (role player) to play a role in a particular instance of a relation type.

Roles allow a schema to enforce logical constraints on types of role players.

Fields
Name Type Description

label

String

label

pub fn label(&self) -> &str

Retrieves the unique label of the RoleType.

Returns
&str
Code examples
role_type.label()

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/schema/Trait_RoleTypeAPI.adoc[]

AttributeType

Implements traits:

  • Clone

  • Debug

  • Display

  • PartialEq

  • StructuralPartialEq

Attribute types represent properties that other types can own.

Attribute types have a value type. This value type is fixed and unique for every given instance of the attribute type.

Other types can own an attribute type. That means that instances of these other types can own an instance of this attribute type. This usually means that an object in our domain has a property with the matching value.

Multiple types can own the same attribute type, and different instances of the same type or different types can share ownership of the same attribute instance.

Fields
Name Type Description

label

String

value_type

Option<ValueType>

label

pub fn label(&self) -> &str

Retrieves the unique label of the AttributeType.

Returns
&str
Code examples
attribute_type.label()

value_type

pub fn value_type(&self) -> Option<&ValueType>

Retrieves the ValueType of the AttributeType.

Returns
Option<&ValueType>
Code examples
attribute_type.value_type()

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/schema/Trait_AttributeTypeAPI.adoc[]

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/schema/Annotation.adoc[]

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/schema/Transitivity.adoc[]

ValueType

Represents the type of primitive value is held by a Value or Attribute.

Enum variants
Variant

Boolean

Date

Datetime

DatetimeTZ

Decimal

Double

Duration

Integer

String

Struct(String)

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/schema/ScopedLabel.adoc[]

Data

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/data/Thing.adoc[]

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/data/Trait_ThingAPI.adoc[]

Entity

Implements traits:

  • Clone

  • Debug

  • Eq

  • PartialEq

  • StructuralPartialEq

Instance of data of an entity type, representing a standalone object that exists in the data model independently. Entity does not have a value. It is usually addressed by its ownership over attribute instances and/or roles played in relation instances.

Fields
Name Type Description

iid

IID

The unique id of this Entity

type_

Option<EntityType>

The type which this Entity belongs to

iid

pub fn iid(&self) -> &IID

Retrieves the unique id of the Entity.

Returns
&IID
Code examples
entity.iid();

Relation

Implements traits:

  • Clone

  • Debug

  • Eq

  • PartialEq

  • StructuralPartialEq

Relation is an instance of a relation type and can be uniquely addressed by a combination of its type, owned attributes and role players.

Fields
Name Type Description

iid

IID

The unique id of this Relation

type_

Option<RelationType>

The type which this Relation belongs to

iid

pub fn iid(&self) -> &IID

Retrieves the unique id of the Relation.

Returns
&IID
Code examples
relation.iid();

Attribute

Implements traits:

  • Clone

  • Debug

  • PartialEq

  • StructuralPartialEq

Attribute is an instance of the attribute type and has a value. This value is fixed and unique for every given instance of the attribute type. Attributes can be uniquely addressed by their type and value.

Fields
Name Type Description

iid

IID

The unique id of this Attribute (internal use only)

type_

Option<AttributeType>

The type which this Attribute belongs to

value

Value

The (dataful) value of this attribute

Value

Enum variants
Variant

Boolean(bool)

Date(NaiveDate)

Datetime(NaiveDateTime)

DatetimeTZ(DateTime<TimeZone>)

Decimal(Decimal)

Double(f64)

Duration(Duration)

Integer(i64)

String(String)

Struct(Struct, String)

get_type

pub fn get_type(&self) -> ValueType

Retrieves the ValueType of this value concept.

Returns
ValueType
Code examples
value.get_type();

get_type_name

pub fn get_type_name(&self) -> &str

Retrieves the name of the ValueType of this value concept.

Returns
&str
Code examples
value.get_type_name();

Logic

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/logic/LogicManager.adoc[]

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/logic/Rule.adoc[]

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/logic/Trait_RuleAPI.adoc[]

Errors

Unresolved include directive in modules/ROOT/partials/rust/api-reference.adoc - include::api-ref::partial$rust/errors/SchemaException.adoc[]

Error

Represents errors encountered during operation.

Enum variants
Variant

Concept(ConceptError)

Connection(ConnectionError)

Internal(InternalError)

Other(String)

Server(ServerError)

ConnectionError

Enum variants
Variant

AddressTranslationMismatch

BrokenPipe

ClusterAllNodesFailed

ClusterReplicaNotPrimary

ClusterTokenCredentialInvalid

ConnectionFailed

DatabaseNotFound

EncryptionSettingsMismatch

InvalidResponseField

ListsNotImplemented

MissingPort

MissingResponseField

QueryStreamNoResponse

RPCMethodUnavailable

SSLCertificateNotValidated

ServerConnectionFailed

ServerConnectionFailedStatusError

ServerConnectionFailedWithError

ServerConnectionIsClosed

TransactionIsClosed

TransactionIsClosedWithErrors

UnexpectedConnectionClose

UnexpectedKind

UnexpectedQueryType

UnexpectedResponse

UnknownRequestId

ValueStructNotImplemented

ValueTimeZoneNameNotRecognised

ValueTimeZoneOffsetNotRecognised

InternalError

Enum variants
Variant

EnumOutOfBounds

RecvError

SendError

UnexpectedRequestType

UnexpectedResponseType

UnknownServer