Rust driver API reference
Connection
TypeDBDriver
Implements traits:
-
Debug
A connection to a TypeDB server which serves as the starting point for all interaction.
force_close
pub fn force_close(&self) -> Result
Closes this connection if it is open.
Result
connection.force_close()
is_cloud
pub fn is_cloud(&self) -> bool
Check if the connection is to an Cloud server.
bool
connection.is_cloud()
is_open
pub fn is_open(&self) -> bool
Checks it this connection is opened.
bool
connection.is_open()
new_cloud
-
async
-
sync
pub async fn new_cloud<T: AsRef<str> + Sync>(
init_addresses: &Vec<T>,
credentials: Credentials,
driver_options: DriverOptions,
) -> Result<Self>
pub fn new_cloud<T: AsRef<str> + Sync>(
init_addresses: &Vec<T>,
credentials: Credentials,
driver_options: DriverOptions,
) -> Result<Self>
Creates a new TypeDB Cloud connection.
Name | Description | Type |
---|---|---|
|
— Addresses (host:port) on which TypeDB Cloud nodes are running |
|
|
— The Credentials to connect with |
|
|
— The DriverOptions to connect with |
|
Result<Self>
new_cloud_with_description
-
async
-
sync
pub async fn new_cloud_with_description<T: AsRef<str> + Sync>(
init_addresses: &Vec<T>,
credentials: Credentials,
driver_options: DriverOptions,
driver_lang: impl AsRef<str>,
) -> Result<Self>
pub fn new_cloud_with_description<T: AsRef<str> + Sync>(
init_addresses: &Vec<T>,
credentials: Credentials,
driver_options: DriverOptions,
driver_lang: impl AsRef<str>,
) -> Result<Self>
Creates a new TypeDB Cloud connection.
Name | Description | Type |
---|---|---|
|
— Addresses (host:port) on which TypeDB Cloud nodes are running |
|
|
— The Credentials to connect with |
|
|
— The DriverOptions to connect with |
|
|
— The language of the driver connecting to the server |
|
Result<Self>
new_cloud_with_translation
-
async
-
sync
pub async fn new_cloud_with_translation<T, U>(
address_translation: HashMap<T, U>,
credential: Credentials,
driver_options: DriverOptions,
) -> Result<Self>where
T: AsRef<str> + Sync,
U: AsRef<str> + Sync,
pub fn new_cloud_with_translation<T, U>(
address_translation: HashMap<T, U>,
credential: Credentials,
driver_options: DriverOptions,
) -> Result<Self>where
T: AsRef<str> + Sync,
U: AsRef<str> + Sync,
Creates a new TypeDB Cloud connection.
Name | Description | Type |
---|---|---|
|
— Translation map from addresses to be used by the driver for connection to addresses received from the TypeDB server(s) |
|
|
— The Credentials to connect with |
|
|
— The DriverOptions to connect with |
|
Result<Self>where
T: AsRef<str> + Sync,
U: AsRef<str> + Sync,
new_cloud_with_translation_with_description
-
async
-
sync
pub async fn new_cloud_with_translation_with_description<T, U>(
address_translation: HashMap<T, U>,
credentials: Credentials,
driver_options: DriverOptions,
driver_lang: impl AsRef<str>,
) -> Result<Self>where
T: AsRef<str> + Sync,
U: AsRef<str> + Sync,
pub fn new_cloud_with_translation_with_description<T, U>(
address_translation: HashMap<T, U>,
credentials: Credentials,
driver_options: DriverOptions,
driver_lang: impl AsRef<str>,
) -> Result<Self>where
T: AsRef<str> + Sync,
U: AsRef<str> + Sync,
Creates a new TypeDB Cloud connection.
Name | Description | Type |
---|---|---|
|
— Translation map from addresses to be used by the driver for connection to addresses received from the TypeDB server(s) |
|
|
— The Credentials to connect with |
|
|
— The DriverOptions to connect with |
|
|
— The language of the driver connecting to the server |
|
Result<Self>where
T: AsRef<str> + Sync,
U: AsRef<str> + Sync,
new_core
-
async
-
sync
pub async fn new_core(
address: impl AsRef<str>,
credentials: Credentials,
driver_options: DriverOptions,
) -> Result<Self>
pub fn new_core(
address: impl AsRef<str>,
credentials: Credentials,
driver_options: DriverOptions,
) -> Result<Self>
Creates a new TypeDB Server connection.
Name | Description | Type |
---|---|---|
|
— The address (host:port) on which the TypeDB Server is running |
|
|
— The Credentials to connect with |
|
|
— The DriverOptions to connect with |
|
Result<Self>
-
async
-
sync
Connection::new_core("127.0.0.1:1729").await
Connection::new_core("127.0.0.1:1729")
new_core_with_description
-
async
-
sync
pub async fn new_core_with_description(
address: impl AsRef<str>,
credentials: Credentials,
driver_options: DriverOptions,
driver_lang: impl AsRef<str>,
) -> Result<Self>
pub fn new_core_with_description(
address: impl AsRef<str>,
credentials: Credentials,
driver_options: DriverOptions,
driver_lang: impl AsRef<str>,
) -> Result<Self>
Creates a new TypeDB Server connection with a description.
Name | Description | Type |
---|---|---|
|
— The address (host:port) on which the TypeDB Server is running |
|
|
— The Credentials to connect with |
|
|
— The DriverOptions to connect with |
|
|
— The language of the driver connecting to the server |
|
Result<Self>
-
async
-
sync
Connection::new_core("127.0.0.1:1729", "rust").await
Connection::new_core("127.0.0.1:1729", "rust")
Credentials
Implements traits:
-
Clone
-
Debug
User credentials for connecting to TypeDB
new
pub fn new(username: &str, password: &str) -> Self
Creates a credentials with username and password.
Name | Description | Type |
---|---|---|
|
— The name of the user to connect as |
|
|
— The password for the user |
|
Self
Credentials::new(username, password);
DriverOptions
Implements traits:
-
Clone
-
Debug
User connection settings for connecting to TypeDB.
is_tls_enabled
pub fn is_tls_enabled(&self) -> bool
Retrieves whether TLS is enabled for the connection.
bool
new
pub fn new(is_tls_enabled: bool, tls_root_ca: Option<&Path>) -> Result<Self>
Creates a credentials with username and password. Specifies the connection must use TLS
Name | Description | Type |
---|---|---|
|
— Specify whether the connection to TypeDB Server must be done over TLS. |
|
|
— Path to the CA certificate to use for authenticating server certificates. |
|
Result<Self>
DriverOptions::new(true, Some(&path_to_ca));
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
Result<Vec<Arc<Database>>>
-
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
Name | Description | Type |
---|---|---|
|
— The database name to be checked |
|
Result<bool>
-
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
Name | Description | Type |
---|---|---|
|
— The name of the database to be created |
|
Result
-
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.
Name | Description | Type |
---|---|---|
|
— The name of the database to retrieve |
|
Result<Arc<Database>>
-
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.
Result
-
async
-
sync
database.delete().await;
database.delete();
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
Option<ReplicaInfo>
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
Option<ReplicaInfo>
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
Vec<ReplicaInfo>
database.replicas_info()
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.
Result<Vec<User>>
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.
Name | Description | Type |
---|---|---|
|
— The user name to be checked |
|
Result<bool>
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.
Name | Description | Type |
---|---|---|
|
— The name of the user to be created |
|
|
— The password of the user to be created |
|
Result
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.
Name | Description | Type |
---|---|---|
|
— The name of the user to retrieve |
|
Result<Option<User>>
driver.users.get(username).await;
User
Implements traits:
-
Clone
-
Debug
Name | Type | Description |
---|---|---|
|
|
|
|
|
|
|
|
delete
-
async
-
sync
pub async fn delete(self) -> Result
pub fn delete(self) -> Result
Deletes this user
Name | Description | Type |
---|---|---|
|
— The name of the user to be deleted |
Result
-
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.
Name | Description | Type |
---|---|---|
|
— The name of the user |
|
|
— The new password |
|
Result<()>
-
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;
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.
impl Promise<'static, Result>
-
async
-
sync
transaction.commit().await
transaction.commit()
force_close
pub fn force_close(&self)
Closes the transaction.
null
transaction.force_close()
is_open
pub fn is_open(&self) -> bool
Closes the transaction.
bool
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.
Name | Description | Type |
---|---|---|
|
— The callback function. |
null
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
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.
Name | Description | Type |
---|---|---|
|
— The TypeQL query to be executed |
|
|
— Query options |
|
impl Promise<'static, Result<QueryAnswer>>
transaction.query_with_options(query, options)
Answer
QueryAnswer
Variant |
---|
|
|
|
get_query_type
pub fn get_query_type(&self) -> QueryType
Retrieve the executed query’s type (shared by all elements in this stream).
QueryType
query_answer.get_query_type()
into_documents
pub fn into_documents(self) -> BoxStream<'static, Result<ConceptDocument>>
Unwraps the QueryAnswer
into a ConceptDocumentStream
. Panics if it is not a ConceptDocumentStream
.
BoxStream<'static, Result<ConceptDocument>>
query_answer.into_documents()
into_rows
pub fn into_rows(self) -> BoxStream<'static, Result<ConceptRow>>
Unwraps the QueryAnswer
into a ConceptRowStream
. Panics if it is not a ConceptRowStream
.
BoxStream<'static, Result<ConceptRow>>
query_answer.into_rows()
is_document_stream
pub fn is_document_stream(&self) -> bool
Check if the QueryAnswer
is a ConceptDocumentStream
.
bool
query_answer.is_document_stream()
ConceptRow
Implements traits:
-
Clone
-
Debug
-
Display
-
PartialEq
-
StructuralPartialEq
A single row of concepts representing substitutions for variables in the query. Contains a Header (column names and query type), and the row of optional concepts. An empty concept in a column means the variable does not have a substitution in this answer.
Name | Type | Description |
---|---|---|
|
|
get
pub fn get(&self, column_name: &str) -> Result<Option<&Concept>>
Retrieves a concept for a given variable. Returns an empty optional if the variable name has an empty answer. Returns an error if the variable name is not present.
Name | Description | Type |
---|---|---|
|
— The variable name in the row to retrieve |
Result<Option<&Concept>>
concept_row.get(var_name)
get_column_names
pub fn get_column_names(&self) -> &[String]
Retrieve the row column names (shared by all elements in this stream).
&[String]
concept_row.get_column_names()
get_concepts
pub fn get_concepts(&self) -> impl Iterator<Item = &Concept>
Produces an iterator over all concepts in this ConceptRow
, skipping empty results
impl Iterator<Item = &Concept>
concept_row.concepts()
get_index
pub fn get_index(&self, column_index: usize) -> Result<Option<&Concept>>
Retrieves a concept for a given column index. Returns an empty optional if the index points to an empty answer. Returns an error if the index is not in the row’s range.
Name | Description | Type |
---|---|---|
|
— The position in the row to retrieve |
|
Result<Option<&Concept>>
concept_row.get_position(column_index)
ConceptRowHeader
Implements traits:
-
Debug
-
PartialEq
-
StructuralPartialEq
Name | Type | Description |
---|---|---|
|
|
|
|
|
ConceptDocument
Implements traits:
-
Clone
-
Debug
-
PartialEq
-
StructuralPartialEq
A single document of concepts representing substitutions for variables in the query. Contains a Header (query type), and the document of concepts.
Name | Type | Description |
---|---|---|
|
|
ConceptDocumentHeader
Implements traits:
-
Debug
-
PartialEq
-
StructuralPartialEq
Name | Type | Description |
---|---|---|
|
|
JSON
Variant |
---|
|
|
|
|
|
|
QueryType
This enum is used to specify the type of the query resulted in this answer.
Variant |
---|
|
|
|
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.
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()
.
promise.resolve()
Concept
Concept
The fundamental TypeQL object.
Variant |
---|
|
|
|
|
|
|
|
|
get_category
pub fn get_category(&self) -> ConceptCategory
Retrieves the category of this Concept.
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.
&str
is_attribute
pub fn is_attribute(&self) -> bool
Check if this Concept represents an Attribute instance from the database
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
bool
is_boolean
pub fn is_boolean(&self) -> bool
Check if this Concept holds a boolean as an AttributeType, an Attribute, or a Value
bool
is_date
pub fn is_date(&self) -> bool
Check if this Concept holds a date as an AttributeType, an Attribute, or a Value
bool
is_datetime
pub fn is_datetime(&self) -> bool
Check if this Concept holds a datetime as an AttributeType, an Attribute, or a Value
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
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
bool
is_double
pub fn is_double(&self) -> bool
Check if this Concept holds a double as an AttributeType, an Attribute, or a Value
bool
is_duration
pub fn is_duration(&self) -> bool
Check if this Concept holds a duration as an AttributeType, an Attribute, or a Value
bool
is_entity
pub fn is_entity(&self) -> bool
Check if this Concept represents an Entity instance from the database
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
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:
bool
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
bool
is_relation
pub fn is_relation(&self) -> bool
Check if this Concept represents an Relation instance from the database
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
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
bool
is_string
pub fn is_string(&self) -> bool
Check if this Concept holds a string as an AttributeType, an Attribute, or a Value
bool
is_struct
pub fn is_struct(&self) -> bool
Check if this Concept holds a struct as an AttributeType, an Attribute, or a Value
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:
bool
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Option<ValueType>
Schema
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.
Name | Type | Description |
---|---|---|
|
|
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.
Name | Type | Description |
---|---|---|
|
|
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.
Name | Type | Description |
---|---|---|
|
|
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.
Name | Type | Description |
---|---|---|
|
|
|
|
|
Data
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.
Name | Type | Description |
---|---|---|
|
|
The unique id of this Entity |
|
|
The type which this Entity belongs to |
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.
Name | Type | Description |
---|---|---|
|
|
The unique id of this Relation |
|
|
The type which this Relation belongs to |
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.
Name | Type | Description |
---|---|---|
|
|
The unique id of this Attribute (internal use only) |
|
|
The type which this Attribute belongs to |
|
|
The (dataful) value of this attribute |
Value
Variant |
---|
|
|
|
|
|
|
|
|
|
|
Value
Decimal
Implements traits:
-
Add
-
Clone
-
Copy
-
Debug
-
Default
-
Display
-
Eq
-
Hash
-
Neg
-
Ord
-
PartialEq
-
PartialOrd
-
StructuralPartialEq
-
Sub
A fixed-point decimal number. Holds exactly 19 digits after the decimal point and a 64-bit value before the decimal point.
Duration
Implements traits:
-
Clone
-
Copy
-
Debug
-
Display
-
Eq
-
FromStr
-
Hash
-
PartialEq
-
StructuralPartialEq
-
TryFrom<Duration>
A relative duration, which contains months, days, and nanoseconds. Can be used for calendar-relative durations (eg 7 days forward), or for absolute durations using the nanosecond component When used as an absolute duration, convertible to chrono::Duration
Name | Type | Description |
---|---|---|
|
|
|
|
|
|
|
|
Errors
Error
Represents errors encountered during operation.
Variant |
---|
|
|
|
|
|
ConnectionError
Variant |
---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|