C gRPC driver
Connection
driver
driver_close
void driver_close(struct TypeDBDriver* driver)
Closes the driver. Before instantiating a new driver, the driver that’s currently open should first be closed. Closing a driver frees the underlying Rust object.
void
driver_force_close
void driver_force_close(struct TypeDBDriver* driver)
Forcibly closes the driver. To be used in exceptional cases.
void
driver_is_open
bool driver_is_open(const struct TypeDBDriver* driver)
Checks whether this connection is presently open.
bool
driver_open
struct TypeDBDriver* driver_open(const char* address, const struct Credentials* credentials, const struct DriverOptions* driver_options)
Open a TypeDB C Driver to a TypeDB server available at the provided address.
| Name | Description | Type |
|---|---|---|
|
The address (host:port) on which the TypeDB Server is running |
|
|
The |
|
|
The |
|
struct TypeDBDriver*
driver_open_with_description
struct TypeDBDriver* driver_open_with_description(const char* address, const struct Credentials* credentials, const struct DriverOptions* driver_options, const char* driver_lang)
Open a TypeDB Driver to a TypeDB server available at the provided address. This method allows driver language specification for drivers built on top of the native C layer.
| Name | Description | Type |
|---|---|---|
|
The address (host:port) on which the TypeDB Server is running |
|
|
The |
|
|
The |
|
|
The language of the driver connecting to the server |
|
struct TypeDBDriver*
init_logging
void init_logging(void)
Enables logging in the TypeDB driver.
This function sets up tracing with two environment variables:
``TYPEDB_DRIVER_LOG``: Fine-grained control using the same syntax as ``RUST_LOG``. Example: ``TYPEDB_DRIVER_LOG=typedb_driver=debug,typedb_driver_clib=trace`` ``TYPEDB_DRIVER_LOG_LEVEL``: Simple log level that applies to both ``typedb_driver`` and ``typedb_driver_clib`` crates. Overrides any settings from ``TYPEDB_DRIVER_LOG``. Example: ``TYPEDB_DRIVER_LOG_LEVEL=debug``
If neither is set, the default level is INFO for driver crates.
The logging is initialized only once to prevent multiple initializations in applications that create multiple drivers.
void
databases
database_schema
char* database_schema(const struct Database* database)
A full schema text as a valid TypeQL define query string.
char*
databases_all
struct DatabaseIterator* databases_all(struct TypeDBDriver* driver)
Returns a DatabaseIterator over all databases present on the TypeDB server.
struct DatabaseIterator*
databases_contains
bool databases_contains(struct TypeDBDriver* driver, const char* name)
Checks if a database with the given name exists.
bool
databases_create
void databases_create(struct TypeDBDriver* driver, const char* name)
Create a database with the given name.
void
databases_get
const struct Database* databases_get(struct TypeDBDriver* driver, const char* name)
Retrieve the database with the given name.
const struct Database*
databases_import_from_file
void databases_import_from_file(struct TypeDBDriver* driver, const char* name, const char* schema, const char* data_file)
Create a database with the given name based on previously exported another database’s data loaded from a file. This is a blocking operation and may take a significant amount of time depending on the database size.
| Name | Description | Type |
|---|---|---|
|
The |
|
|
The name of the database to be created. |
|
|
The schema definition query string for the database. |
|
|
The exported database file path to import the data from. |
|
void
database
database_close
void database_close(const struct Database* database)
Frees the native rust Database object
void
database_delete
void database_delete(const struct Database* database)
Deletes this database.
void
database_export_to_file
void database_export_to_file(const struct Database* database, const char* schema_file, const char* data_file)
Export a database into a schema definition and a data files saved to the disk. This is a blocking operation and may take a significant amount of time depending on the database size.
| Name | Description | Type |
|---|---|---|
|
The |
|
|
The path to the schema definition file to be created. |
|
|
The path to the data file to be created. |
|
void
databaseiterator
users
users_all
struct UserIterator* users_all(const struct TypeDBDriver* driver)
Retrieves all users which exist on the TypeDB server.
struct UserIterator*
users_contains
bool users_contains(const struct TypeDBDriver* driver, const char* username)
Checks if a user with the given name exists.
bool
users_create
void users_create(const struct TypeDBDriver* driver, const char* username, const char* password)
Creates a user with the given name & password.
void
user
user_update_password
void user_update_password(struct User* user, const char* password)
Updates the password for the current authenticated user.
| Name | Description | Type |
|---|---|---|
|
The user to update the password of - must be the current user. |
|
|
The |
|
|
The current password of this user |
|
|
The new password |
void
Transaction
transaction
transaction_analyze
struct AnalyzedQueryPromise* transaction_analyze(struct Transaction* transaction, const char* query)
Analyzes a TypeQL query in the transaction.
| Name | Description | Type |
|---|---|---|
|
The |
|
|
The query string. |
|
struct AnalyzedQueryPromise*
transaction_close
struct VoidPromise* transaction_close(struct Transaction* txn)
Forcibly closes this transaction. To be used in exceptional cases.
struct VoidPromise*
transaction_commit
struct VoidPromise* transaction_commit(struct Transaction* txn)
Commits the changes made via this transaction to the TypeDB database. Whether or not the transaction is commited successfully, the transaction is closed after the commit call and the native rust object is freed.
struct VoidPromise*
transaction_is_open
bool transaction_is_open(const struct Transaction* txn)
Checks whether this transaction is open.
bool
transaction_new
struct Transaction* transaction_new(struct TypeDBDriver* driver, const char* database_name, enum TransactionType type_, const struct TransactionOptions* options)
Opens a transaction to perform read or write queries on the database connected to the session.
| Name | Description | Type |
|---|---|---|
|
The |
|
|
The name of the database with which the transaction connects. |
|
|
The type of transaction to be created (Write / Read / Schema). |
|
|
|
|
struct Transaction*
transaction_on_close
struct VoidPromise* transaction_on_close(const struct Transaction* txn, uintptr_t callback_id, void(*)(uintptr_t, struct Error*) callback)
Registers a callback function which will be executed when this transaction is closed.
| Name | Description | Type |
|---|---|---|
|
The transaction on which to register the callback |
|
|
The argument to be passed to the callback function when it is executed. |
|
|
The function to be called |
struct VoidPromise*
transaction_query
struct QueryAnswerPromise* transaction_query(struct Transaction* transaction, const char* query, const struct QueryOptions* options)
Performs a TypeQL query in the transaction.
| Name | Description | Type |
|---|---|---|
|
The |
|
|
The query string. |
|
|
|
|
struct QueryAnswerPromise*
transactionoptions
Struct TransactionOptions
class
TypeDB transaction options. TransactionOptions object can be used to override the default server behaviour for opened transactions.
transaction_options_drop
void transaction_options_drop(struct TransactionOptions* options)
Frees the native Rust TransactionOptions object.
void
transaction_options_get_schema_lock_acquire_timeout_millis
int64_t transaction_options_get_schema_lock_acquire_timeout_millis(const struct TransactionOptions* options)
Returns the value set for the schema lock acquire timeout in this TransactionOptions object. If set, specifies how long the driver should wait if opening a transaction is blocked by an exclusive schema write lock.
int64_t
transaction_options_get_transaction_timeout_millis
int64_t transaction_options_get_transaction_timeout_millis(const struct TransactionOptions* options)
Returns the value set for the transaction timeout in this TransactionOptions object. If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions.
int64_t
transaction_options_has_schema_lock_acquire_timeout_millis
bool transaction_options_has_schema_lock_acquire_timeout_millis(const struct TransactionOptions* options)
Checks whether the option for schema lock acquire timeout was explicitly set for this TransactionOptions object.
bool
transaction_options_has_transaction_timeout_millis
bool transaction_options_has_transaction_timeout_millis(const struct TransactionOptions* options)
Checks whether the option for transaction timeout was explicitly set for this TransactionOptions object.
bool
transaction_options_new
struct TransactionOptions* transaction_options_new(void)
Produces a new TransactionOptions object.
struct TransactionOptions*
transaction_options_set_schema_lock_acquire_timeout_millis
void transaction_options_set_schema_lock_acquire_timeout_millis(struct TransactionOptions* options, int64_t timeout_millis)
Explicitly sets schema lock acquire timeout. If set, specifies how long the driver should wait if opening a transaction is blocked by an exclusive schema write lock.
void
transaction_options_set_transaction_timeout_millis
void transaction_options_set_transaction_timeout_millis(struct TransactionOptions* options, int64_t timeout_millis)
Explicitly set a transaction timeout. If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions.
void
queryoptions
Struct QueryOptions
class
TypeDB query options. QueryOptions object can be used to override the default server behaviour for executed queries.
query_options_drop
void query_options_drop(struct QueryOptions* options)
Frees the native Rust QueryOptions object.
void
query_options_get_include_instance_types
bool query_options_get_include_instance_types(const struct QueryOptions* options)
Returns the value set for the "include instance types" flag in this QueryOptions object. If set, specifies if types should be included in instance structs returned in ConceptRow answers. This option allows reducing the amount of unnecessary data transmitted.
bool
query_options_get_include_query_structure
bool query_options_get_include_query_structure(const struct QueryOptions* options)
Returns the value set for 'include query structure' in this QueryOptions object.
bool
query_options_get_prefetch_size
int64_t query_options_get_prefetch_size(const struct QueryOptions* options)
Returns the value set for the prefetch size in this QueryOptions object. If set, specifies the number of extra query responses sent before the client side has to re-request more responses. Increasing this may increase performance for queries with a huge number of answers, as it can reduce the number of network round-trips at the cost of more resources on the server side. Minimal value: 1.
int64_t
query_options_has_include_instance_types
bool query_options_has_include_instance_types(const struct QueryOptions* options)
Checks whether the "include instance types" flag was explicitly set for this QueryOptions object.
bool
query_options_has_include_query_structure
bool query_options_has_include_query_structure(const struct QueryOptions* options)
Checks whether the prefetch size was explicitly set for this QueryOptions object.
bool
query_options_has_prefetch_size
bool query_options_has_prefetch_size(const struct QueryOptions* options)
Checks whether the prefetch size was explicitly set for this QueryOptions object.
bool
query_options_new
struct QueryOptions* query_options_new(void)
Produces a new QueryOptions object.
struct QueryOptions*
query_options_set_include_instance_types
void query_options_set_include_instance_types(struct QueryOptions* options, bool include_instance_types)
Explicitly set the "include instance types" flag. If set, specifies if types should be included in instance structs returned in ConceptRow answers. This option allows reducing the amount of unnecessary data transmitted.
void
query_options_set_include_query_structure
void query_options_set_include_query_structure(struct QueryOptions* options, bool include_query_structure)
Explicitly set the prefetch size. If set, it requests the server to include the query structure in the answer header.
void
query_options_set_prefetch_size
void query_options_set_prefetch_size(struct QueryOptions* options, int64_t prefetch_size)
Explicitly set the prefetch size. If set, specifies the number of extra query responses sent before the client side has to re-request more responses. Increasing this may increase performance for queries with a huge number of answers, as it can reduce the number of network round-trips at the cost of more resources on the server side. Minimal value: 1.
void
Answer
queryanswer
query_answer_drop
void query_answer_drop(struct QueryAnswer* query_answer)
Frees the native rust QueryAnswer object.
void
query_answer_get_query_type
enum QueryType query_answer_get_query_type(const struct QueryAnswer* query_answer)
Retrieve the executed query’s type of the QueryAnswer.
enum QueryType
query_answer_into_documents
struct StringIterator* query_answer_into_documents(struct QueryAnswer* query_answer)
Produces an Iterator over all JSON ConceptDocuments in this QueryAnswer.
struct StringIterator*
query_answer_into_rows
struct ConceptRowIterator* query_answer_into_rows(struct QueryAnswer* query_answer)
Produces an Iterator over all ConceptRows in this QueryAnswer.
struct ConceptRowIterator*
query_answer_is_concept_document_stream
bool query_answer_is_concept_document_stream(const struct QueryAnswer* query_answer)
Checks if the query answer is a ConceptDocumentStream.
bool
queryanswerpromise
Struct QueryAnswerPromise
class
Promise object representing the result of an asynchronous operation. Use query_answer_promise_resolve(QueryAnswerPromise*) to wait for and retrieve the resulting boolean value.
query_answer_promise_drop
void query_answer_promise_drop(struct QueryAnswerPromise* promise)
Frees the native rust QueryAnswerPromise object.
void
query_answer_promise_resolve
struct QueryAnswer* query_answer_promise_resolve(struct QueryAnswerPromise* promise)
Waits for and returns the result of the operation represented by the QueryAnswer object. In case the operation failed, the error flag will only be set when the promise is resolved. The native promise object is freed when it is resolved.
struct QueryAnswer*
conceptrow
Struct ConceptRow
class
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.
concept_row_drop
void concept_row_drop(struct ConceptRow* concept_row)
Frees the native rust ConceptRow object.
void
concept_row_equals
bool concept_row_equals(const struct ConceptRow* lhs, const struct ConceptRow* rhs)
Checks whether the provided ConceptRow objects are equal
bool
concept_row_get
struct Concept* concept_row_get(const struct ConceptRow* concept_row, const char* column_name)
Retrieves a concept for a given column name.
struct Concept*
concept_row_get_column_names
struct StringIterator* concept_row_get_column_names(const struct ConceptRow* concept_row)
Produces an Iterator over all String column names of the ConceptRow's header.
struct StringIterator*
concept_row_get_concepts
struct ConceptIterator* concept_row_get_concepts(const struct ConceptRow* concept_row)
Produces an Iterator over all Concepts in this ConceptRow.
struct ConceptIterator*
concept_row_get_index
struct Concept* concept_row_get_index(const struct ConceptRow* concept_row, uintptr_t column_index)
Retrieves a concept for a given column index.
struct Concept*
concept_row_get_query_structure
struct Pipeline* concept_row_get_query_structure(const struct ConceptRow* concept_row)
Retrieve the executed query’s structure from the ConceptRow's header, if set. It must be requested via "include query structure" in QueryOptions
struct Pipeline*
concept_row_get_query_type
enum QueryType concept_row_get_query_type(const struct ConceptRow* concept_row)
Retrieve the executed query’s type of the ConceptRow's header.
enum QueryType
conceptrowiterator
voidpromise
Struct VoidPromise
class
Promise object representing the result of an asynchronous operation. A VoidPromise does not return a value, but must be resolved using void_promise_resolve(VoidPromise*) to ensure the operation has completed, or for a failed operation to set the error.
void_promise_drop
void void_promise_drop(struct VoidPromise* promise)
Frees the native rust VoidPromise object.
void
void_promise_resolve
void void_promise_resolve(struct VoidPromise* promise)
Waits for the operation represented by the VoidPromise to complete. In case the operation failed, the error flag will only be set when the promise is resolved. The native promise object is freed when it is resolved.
void
boolpromise
Struct BoolPromise
class
Promise object representing the result of an asynchronous operation. Use bool_promise_resolve(BoolPromise*) to wait for and retrieve the resulting boolean value.
bool_promise_drop
void bool_promise_drop(struct BoolPromise* promise)
Frees the native rust BoolPromise object.
void
bool_promise_resolve
bool bool_promise_resolve(struct BoolPromise* promise)
Waits for and returns the result of the operation represented by the BoolPromise object. In case the operation failed, the error flag will only be set when the promise is resolved. The native promise object is freed when it is resolved.
bool
stringpromise
Struct StringPromise
class
Promise object representing the result of an asynchronous operation. Use string_promise_resolve(StringPromise*) to wait for and retrieve the resulting string.
string_promise_drop
void string_promise_drop(struct StringPromise* promise)
Frees the native rust StringPromise object.
void
string_promise_resolve
char* string_promise_resolve(struct StringPromise* promise)
Waits for and returns the result of the operation represented by the BoolPromise object. In case the operation failed, the error flag will only be set when the promise is resolved. The native promise object is freed when it is resolved.
char*
conceptpromise
Struct ConceptPromise
class
Promise object representing the result of an asynchronous operation. Use concept_promise_resolve(ConceptPromise*) to wait for and retrieve the resulting boolean value.
concept_promise_drop
void concept_promise_drop(struct ConceptPromise* promise)
Frees the native rust ConceptPromise object.
void
concept_promise_resolve
struct Concept* concept_promise_resolve(struct ConceptPromise* promise)
Waits for and returns the result of the operation represented by the ConceptPromise object. In case the operation failed, the error flag will only be set when the promise is resolved. The native promise object is freed when it is resolved.
struct Concept*
Concept
concept
concept_drop
void concept_drop(struct Concept* concept)
Frees the native rust Concept object
void
concept_equals
bool concept_equals(const struct Concept* lhs, const struct Concept* rhs)
Checks whether the provided Concept objects are equal
bool
concept_get_boolean
bool concept_get_boolean(const struct Concept* concept)
Returns a boolean value of this value concept. If the value has another type, the error is set.
bool
concept_get_date_as_seconds
int64_t concept_get_date_as_seconds(const struct Concept* concept)
Returns the value of this date value concept as seconds since the start of the UNIX epoch. If the value has another type, the error is set.
int64_t
concept_get_datetime
struct DatetimeInNanos concept_get_datetime(const struct Concept* concept)
Returns the value of this datetime value concept as seconds and nanoseconds parts since the start of the UNIX epoch. If the value has another type, the error is set.
struct DatetimeInNanos
concept_get_datetime_tz
struct DatetimeAndTimeZone concept_get_datetime_tz(const struct Concept* concept)
Returns the value of this datetime-tz value concept as seconds and nanoseconds parts since the start of the UNIX epoch and timezone information. If the value has another type, the error is set.
struct DatetimeAndTimeZone
concept_get_decimal
struct Decimal concept_get_decimal(const struct Concept* concept)
Returns the decimal value of this value concept. If the value has another type, the error is set.
struct Decimal
concept_get_double
double concept_get_double(const struct Concept* concept)
Returns the double value of this value concept. If the value has another type, the error is set.
double
concept_get_duration
struct Duration concept_get_duration(const struct Concept* concept)
Returns the value of this duration value. If the value has another type, the error is set.
struct Duration
concept_get_integer
int64_t concept_get_integer(const struct Concept* concept)
Returns the integer value of this value concept. If the value has another type, the error is set.
int64_t
concept_get_label
char* concept_get_label(const struct Concept* concept)
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.
char*
concept_get_string
char* concept_get_string(const struct Concept* concept)
Returns the string value of this value concept. If the value has another type, the error is set.
char*
concept_get_struct
struct StringAndOptValueIterator* concept_get_struct(const struct Concept* concept)
Returns the value of this struct value concept represented as an iterator of {field_name: value?} pairs. If the value has another type, the error is set.
struct StringAndOptValueIterator*
concept_is_attribute
bool concept_is_attribute(const struct Concept* concept)
Checks if this Concept is an Attribute.
bool
concept_is_attribute_type
bool concept_is_attribute_type(const struct Concept* concept)
Checks if this Concept is an AttributeType.
bool
concept_is_boolean
bool concept_is_boolean(const struct Concept* concept)
Returns true if the value which this Concept holds is of type boolean. Otherwise, returns false.
bool
concept_is_date
bool concept_is_date(const struct Concept* concept)
Returns true if the value which this Concept holds is of type date. Otherwise, returns false.
bool
concept_is_datetime
bool concept_is_datetime(const struct Concept* concept)
Returns true if the value which this Concept holds is of type datetime. Otherwise, returns false.
bool
concept_is_datetime_tz
bool concept_is_datetime_tz(const struct Concept* concept)
Returns true if the value which this Concept holds is of type datetime-tz. Otherwise, returns false.
bool
concept_is_decimal
bool concept_is_decimal(const struct Concept* concept)
Returns true if the value which this Concept holds is of type decimal. Otherwise, returns false.
bool
concept_is_double
bool concept_is_double(const struct Concept* concept)
Returns true if the value which this Concept holds is of type double. Otherwise, returns false.
bool
concept_is_duration
bool concept_is_duration(const struct Concept* concept)
Returns true if the value which this Concept holds is of type duration. Otherwise, returns false.
bool
concept_is_entity
bool concept_is_entity(const struct Concept* concept)
Checks if this Concept is an Entity.
bool
concept_is_entity_type
bool concept_is_entity_type(const struct Concept* concept)
Checks if this Concept is an EntityType.
bool
concept_is_integer
bool concept_is_integer(const struct Concept* concept)
Returns true if the value which this Concept holds is of type integer. Otherwise, returns false.
bool
concept_is_relation
bool concept_is_relation(const struct Concept* concept)
Checks if this Concept is a Relation.
bool
concept_is_relation_type
bool concept_is_relation_type(const struct Concept* concept)
Checks if this Concept is a RelationType.
bool
concept_is_role_type
bool concept_is_role_type(const struct Concept* concept)
Checks if this Concept is a RoleType.
bool
concept_is_string
bool concept_is_string(const struct Concept* concept)
Returns true if the value which this Concept holds is of type string. Otherwise, returns false.
bool
concept_is_struct
bool concept_is_struct(const struct Concept* concept)
Returns true if the value which this Concept holds is of type struct. Otherwise, returns false.
bool
concept_is_value
bool concept_is_value(const struct Concept* concept)
Checks if this Concept is a Value.
bool
concept_to_string
char* concept_to_string(const struct Concept* concept)
A string representation of this Concept object.
char*
concept_try_get_iid
char* concept_try_get_iid(struct Concept* instance)
Retrieves the unique id (IID) of this Concept. If this is an Entity or Relation Instance, returns the IID of the instance. Otherwise, returns null.
char*
concept_try_get_label
char* concept_try_get_label(const struct Concept* concept)
Retrieves the optional label of this 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.
char*
concept_try_get_value
struct Concept* concept_try_get_value(const struct Concept* concept)
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 null.
struct Concept*
concept_try_get_value_type
char* concept_try_get_value_type(const struct Concept* concept)
Retrieves the value type of this Concept, if it exists. If this is an Attribute instance, returns the value type of this instance. If this is a Value, returns its value type. If this is an AttributeType, returns the value type that the schema permits for the attribute type, if one is defined. Otherwise, returns null.
char*
conceptiterator
kind
datetimeandtimezone
stringandoptvalue
stringandoptvalueiterator
Struct StringAndOptValueIterator
class
Iterator over the StringAndOptValues representing struct value {field_name: value?} info.
Analyze
analyzed
analyzedquery
Struct AnalyzedQuery
class
An AnalyzedQuery contains the server’s representation of the query and preamble functions; as well as the result of types inferred for each variable by type-inference.
analyzedquerypromise
analyzed_query_promise_drop
void analyzed_query_promise_drop(struct AnalyzedQueryPromise* promise)
Frees the native rust AnalyzePromise object.
void
analyzed_query_promise_resolve
struct AnalyzedQuery* analyzed_query_promise_resolve(struct AnalyzedQueryPromise* promise)
Waits for and returns the result of the Analyze request. In case the operation failed, the error flag will only be set when the promise is resolved. The native promise object is freed when it is resolved.
struct AnalyzedQuery*
pipeline
pipeline_drop
void pipeline_drop(struct Pipeline* obj)
Frees the native rust Pipeline object.
void
pipeline_get_conjunction
struct Conjunction* pipeline_get_conjunction(const struct Pipeline* pipeline, const struct ConjunctionID* conjunction_id)
Returns the Conjunction corresponding to the ConjunctionID. The Pipeline must be the one that contains the Conjunction & ConjunctionID.
struct Conjunction*
pipelinestage
pipeline_stage_delete_get_deleted_variables
struct VariableIterator* pipeline_stage_delete_get_deleted_variables(const struct PipelineStage* stage)
Unwraps the PipelineStage instance as a Delete stage, and returns the variables deleted. Will panic if the stage is not a Delete.
struct VariableIterator*
pipeline_stage_drop
void pipeline_stage_drop(struct PipelineStage* obj)
Frees the native rust PipelineStage object.
void
pipeline_stage_get_block
struct ConjunctionID* pipeline_stage_get_block(const struct PipelineStage* stage)
Returns the block of the pipeline stage - this is the ConjunctionID of the root conjunction. Will panic if the stage does not have a block.
struct ConjunctionID*
pipeline_stage_limit_get_limit
int64_t pipeline_stage_limit_get_limit(const struct PipelineStage* stage)
Unwraps the PipelineStage instance as a Limit stage, and returns the limit applied. Will panic if the stage is not a Limit stage.
int64_t
pipeline_stage_offset_get_offset
int64_t pipeline_stage_offset_get_offset(const struct PipelineStage* stage)
Unwraps the PipelineStage instance as an Offset stage, and returns the offset applied. Will panic if the stage is not an Offset stage.
int64_t
pipeline_stage_reduce_get_groupby
struct VariableIterator* pipeline_stage_reduce_get_groupby(const struct PipelineStage* stage)
Unwraps the PipelineStage instance as a Reduce stage, and returns the variables being grouped on. Will panic if the stage is not a Reduce stage.
struct VariableIterator*
pipeline_stage_reduce_get_reducer_assignments
struct ReduceAssignmentIterator* pipeline_stage_reduce_get_reducer_assignments(const struct PipelineStage* stage)
Unwraps the PipelineStage instance as a Reduce stage, and returns the reducers applied and the variables their results are assigned to. Will panic if the stage is not a Reduce stage.
struct ReduceAssignmentIterator*
pipeline_stage_require_get_variables
struct VariableIterator* pipeline_stage_require_get_variables(const struct PipelineStage* stage)
Unwraps the PipelineStage instance as a Require stage, and returns the required variables. Will panic if the stage is not a Require stage.
struct VariableIterator*
pipeline_stage_select_get_variables
struct VariableIterator* pipeline_stage_select_get_variables(const struct PipelineStage* stage)
Unwraps the PipelineStage instance as a Select stage, and returns the variables selected. Will panic if the stage is not a Select.
struct VariableIterator*
pipeline_stage_sort_get_sort_variables
struct SortVariableIterator* pipeline_stage_sort_get_sort_variables(const struct PipelineStage* stage)
Unwraps the PipelineStage instance as a Sort stage, and returns the SortVariable. Will panic if the stage is not a Sort stage.
struct SortVariableIterator*
pipeline_stage_string_repr
char* pipeline_stage_string_repr(const struct PipelineStage* stage)
Returns a string representation of the pipeline stage
char*
pipelinestageiterator
conjunction
Struct Conjunction
class
A representation of the constraints involved in the query, and types inferred for each variable.
conjunction_drop
void conjunction_drop(struct Conjunction* obj)
Frees the native rust Conjunction object.
void
conjunction_get_annotated_variables
struct VariableIterator* conjunction_get_annotated_variables(const struct Conjunction* conjunction)
Returns the variables in the current conjunction for which type annotations are available
struct VariableIterator*
conjunctionid
Struct ConjunctionID
class
Holds the index of the conjunction in a Pipeline's conjunctions field. Used as indirection in the representation of a pipeline.
conjunction_id_as_u32
uint32_t conjunction_id_as_u32(const struct ConjunctionID* conjunction_id)
Returns the ConjunctionID as u32 to use in hash, equality etc.
uint32_t
conjunctioniditerator
constraint
constraint_comparison_get_comparator
enum Comparator constraint_comparison_get_comparator(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Comparison constraint, and returns the comparator used in the comparison. Will panic if the Constraint is not a Comparison constraint.
enum Comparator
constraint_comparison_get_lhs
struct ConstraintVertex* constraint_comparison_get_lhs(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Comparison constraint, and returns the left-hand side vertex. Will panic if the Constraint is not a Comparison constraint.
struct ConstraintVertex*
constraint_comparison_get_rhs
struct ConstraintVertex* constraint_comparison_get_rhs(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Comparison constraint, and returns the right-hand side vertex. Will panic if the Constraint is not a Comparison constraint.
struct ConstraintVertex*
constraint_expression_get_arguments
struct ConstraintVertexIterator* constraint_expression_get_arguments(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as an Expression constraint, and returns the expression arguments - These are any variables used in the right-hand side of the expression. Will panic if the Constraint is not an Expression constraint.
struct ConstraintVertexIterator*
constraint_expression_get_assigned
struct ConstraintVertex* constraint_expression_get_assigned(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as an Expression constraint, and returns the variable assigned by the expression. Will panic if the Constraint is not an Expression constraint.
struct ConstraintVertex*
constraint_expression_get_text
char* constraint_expression_get_text(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as an Expression constraint, and returns the expression text. Will panic if the Constraint is not an Expression constraint.
char*
constraint_function_call_get_arguments
struct ConstraintVertexIterator* constraint_function_call_get_arguments(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a FunctionCall constraint, and returns the variables passed as arguments to the function call . Will panic if the Constraint is not a FunctionCall constraint.
struct ConstraintVertexIterator*
constraint_function_call_get_assigned
struct ConstraintVertexIterator* constraint_function_call_get_assigned(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a FunctionCall constraint, and returns the variables assigned by the function call. Will panic if the Constraint is not a FunctionCall constraint.
struct ConstraintVertexIterator*
constraint_function_call_get_name
char* constraint_function_call_get_name(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a FunctionCall constraint, and returns the function name. Will panic if the Constraint is not a FunctionCall constraint.
char*
constraint_has_get_attribute
struct ConstraintVertex* constraint_has_get_attribute(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Has constraint, and returns the attribute vertex. Will panic if the Constraint is not a Has constraint.
struct ConstraintVertex*
constraint_has_get_exactness
enum ConstraintExactness constraint_has_get_exactness(const struct ConstraintWithSpan* constraint)
(FUTURE-USE: Currently always ConstraintExactness::Subtypes) Unwraps the Constraint instance as a Has constraint, and returns the exactness of the attribute match. Will panic if the Constraint is not a Has constraint.
enum ConstraintExactness
constraint_has_get_owner
struct ConstraintVertex* constraint_has_get_owner(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Has constraint, and returns the owner vertex. Will panic if the Constraint is not a Has constraint.
struct ConstraintVertex*
constraint_iid_get_iid
char* constraint_iid_get_iid(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as an Iid constraint, and returns the iid value as a string. Will panic if the Constraint is not an Iid constraint.
char*
constraint_iid_get_variable
struct ConstraintVertex* constraint_iid_get_variable(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as an Iid constraint, and returns the concept (variable) the iid applies to. Will panic if the Constraint is not an Iid constraint.
struct ConstraintVertex*
constraint_is_get_lhs
struct ConstraintVertex* constraint_is_get_lhs(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as an Is constraint, and returns the left-hand side vertex. Will panic if the Constraint is not an Is constraint.
struct ConstraintVertex*
constraint_is_get_rhs
struct ConstraintVertex* constraint_is_get_rhs(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as an Is constraint, and returns the right-hand side vertex. Will panic if the Constraint is not an Is constraint.
struct ConstraintVertex*
constraint_isa_get_exactness
enum ConstraintExactness constraint_isa_get_exactness(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as an Isa constraint, and returns the exactness of the type match. Will panic if the Constraint is not an Isa constraint.
enum ConstraintExactness
constraint_isa_get_instance
struct ConstraintVertex* constraint_isa_get_instance(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as an Isa constraint, and returns the instance vertex. Will panic if the Constraint is not an Isa constraint.
struct ConstraintVertex*
constraint_isa_get_type
struct ConstraintVertex* constraint_isa_get_type(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as an Isa constraint, and returns the type vertex. Will panic if the Constraint is not an Isa constraint.
struct ConstraintVertex*
constraint_kind_get_kind
enum Kind constraint_kind_get_kind(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Kind constraint, and returns the Kind of the type-vertex. Will panic if the Constraint is not a Kind constraint.
enum Kind
constraint_kind_get_type
struct ConstraintVertex* constraint_kind_get_type(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Kind constraint, and returns the associated type vertex. Will panic if the Constraint is not a Kind constraint.
struct ConstraintVertex*
constraint_label_get_label
char* constraint_label_get_label(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Label constraint, and returns the label string. Will panic if the Constraint is not a Label constraint.
char*
constraint_label_get_variable
struct ConstraintVertex* constraint_label_get_variable(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Label constraint, and returns the type-vertex the label applies to. Will panic if the Constraint is not a Label constraint.
struct ConstraintVertex*
constraint_links_get_exactness
enum ConstraintExactness constraint_links_get_exactness(const struct ConstraintWithSpan* constraint)
(FUTURE-USE: Currently always ConstraintExactness::Subtypes) Unwraps the Constraint instance as a Links constraint, and returns the exactness of the role-type match. Will panic if the Constraint is not a Links constraint.
enum ConstraintExactness
constraint_links_get_player
struct ConstraintVertex* constraint_links_get_player(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Links constraint, and returns the player vertex. Will panic if the Constraint is not a Links constraint.
struct ConstraintVertex*
constraint_links_get_relation
struct ConstraintVertex* constraint_links_get_relation(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Links constraint, and returns the relation vertex. Will panic if the Constraint is not a Links constraint.
struct ConstraintVertex*
constraint_links_get_role
struct ConstraintVertex* constraint_links_get_role(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Links constraint, and returns the role vertex. Will panic if the Constraint is not a Links constraint.
struct ConstraintVertex*
constraint_not_get_conjunction
struct ConjunctionID* constraint_not_get_conjunction(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Not constraint, and returns the ConjunctionID of the negated conjunction. Will panic if the Constraint is not a Not constraint.
struct ConjunctionID*
constraint_or_get_branches
struct ConjunctionIDIterator* constraint_or_get_branches(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as an Or constraint, and returns the ConjunctionIDs of the conjunction in each of the branches. Will panic if the Constraint is not an Or constraint.
struct ConjunctionIDIterator*
constraint_owns_get_attribute
struct ConstraintVertex* constraint_owns_get_attribute(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as an Owns constraint, and returns the attribute-type vertex. Will panic if the Constraint is not an Owns constraint.
struct ConstraintVertex*
constraint_owns_get_exactness
enum ConstraintExactness constraint_owns_get_exactness(const struct ConstraintWithSpan* constraint)
(FUTURE-USE: Currently always ConstraintExactness::Subtypes) Will panic if the Constraint is not an Owns constraint.
enum ConstraintExactness
constraint_owns_get_owner
struct ConstraintVertex* constraint_owns_get_owner(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as an Owns constraint, and returns the owner-type vertex. Will panic if the Constraint is not an Owns constraint.
struct ConstraintVertex*
constraint_plays_get_exactness
enum ConstraintExactness constraint_plays_get_exactness(const struct ConstraintWithSpan* constraint)
(FUTURE-USE: Currently always ConstraintExactness::Subtypes)
enum ConstraintExactness
constraint_plays_get_player
struct ConstraintVertex* constraint_plays_get_player(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Plays constraint, and returns the player type vertex. Will panic if the Constraint is not a Plays constraint.
struct ConstraintVertex*
constraint_plays_get_role
struct ConstraintVertex* constraint_plays_get_role(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Plays constraint, and returns the role-type vertex. Will panic if the Constraint is not a Plays constraint.
struct ConstraintVertex*
constraint_relates_get_exactness
enum ConstraintExactness constraint_relates_get_exactness(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Relates constraint, and returns the exactness of the relation match. Will panic if the Constraint is not a Relates constraint.
enum ConstraintExactness
constraint_relates_get_relation
struct ConstraintVertex* constraint_relates_get_relation(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Relates constraint, and returns the relation-type vertex. Will panic if the Constraint is not a Relates constraint.
struct ConstraintVertex*
constraint_relates_get_role
struct ConstraintVertex* constraint_relates_get_role(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Relates constraint, and returns the role-type vertex. Will panic if the Constraint is not a Relates constraint.
struct ConstraintVertex*
constraint_string_repr
char* constraint_string_repr(const struct ConstraintWithSpan* constraint)
Returns a string representation of the constraint
char*
constraint_sub_get_exactness
enum ConstraintExactness constraint_sub_get_exactness(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Sub constraint, and returns the exactness of the subtype match. If Exact (i.e. sub!), only the immediate subtype is returned else, (i.e. sub) the type itself and all subtypes are returned. Will panic if the Constraint is not a Sub constraint.
enum ConstraintExactness
constraint_sub_get_subtype
struct ConstraintVertex* constraint_sub_get_subtype(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Sub constraint, and returns the subtype vertex. Will panic if the Constraint is not a Sub constraint.
struct ConstraintVertex*
constraint_sub_get_supertype
struct ConstraintVertex* constraint_sub_get_supertype(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Sub constraint, and returns the supertype vertex. Will panic if the Constraint is not a Sub constraint.
struct ConstraintVertex*
constraint_try_get_conjunction
struct ConjunctionID* constraint_try_get_conjunction(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Try constraint, and returns the ConjunctionID of the optionally matched conjunction. Will panic if the Constraint is not a Try constraint.
struct ConjunctionID*
constraint_value_get_attribute_type
struct ConstraintVertex* constraint_value_get_attribute_type(const struct ConstraintWithSpan* constraint)
Unwraps the Constraint instance as a Value constraint, and returns the attribute type vertex. Will panic if the Constraint is not a Value constraint.
struct ConstraintVertex*
constraintexactness
Struct ConstraintExactness
class
Tells apart exact variants of constraints from the ones allowing subtype-polymorphism. e.g. isa! would be represented as an Constraint::Isa with its exactness field ConstraintExactness::Exact.
Enum ConstraintExactness
class
Tells apart exact variants of constraints from the ones allowing subtype-polymorphism. e.g. isa! would be represented as an Constraint::Isa with its exactness field ConstraintExactness::Exact.
Enumerator
Exact
Indicates the constraint matches exactly the specified type - e.g. isa! or sub!
Subtypes
Indicates the constraint matches the specified type and its subtypes - e.g. isa! or sub!
| Name |
|---|
|
|
constraintspan
constraintwithspaniterator
constraint_with_span_iterator_drop
void constraint_with_span_iterator_drop(struct ConstraintWithSpanIterator* it)
Frees the native rust ConstraintWithSpanIterator object.
void
constraint_with_span_iterator_next
struct ConstraintWithSpan* constraint_with_span_iterator_next(struct ConstraintWithSpanIterator* it)
Forwards the ConstraintWithSpanIterator and returns the next ConstraintWithSpan if it exists, or null if there are no more elements.
struct ConstraintWithSpan*
constraintvertex
Struct ConstraintVertex
class
The answer to a TypeDB query is a set of concepts which satisfy the Constraints in the query. A ConstraintVertex is either a variable, or some identifier of the concept.
A ``Variable`` is a vertex the query must match and return. A ``Label`` uniquely identifies a type A ``Value`` represents a primitive value literal in TypeDB. A ``NamedRole`` vertex is used in links & relates constraints, as multiple relations may have roles with the same name. The types inferred for ``Variable``, ``Label`` and ``NamedRole`` vertices can be read from the ``variable_annotations`` field of the ``Conjunction`` it is in.
constraint_vertex_as_label
struct Concept* constraint_vertex_as_label(const struct ConstraintVertex* vertex)
Unwraps the ConstraintVertex instance as a Label. Will panic if the instance is not a Label variant.
struct Concept*
constraint_vertex_as_named_role
struct NamedRole* constraint_vertex_as_named_role(const struct ConstraintVertex* vertex)
Unwraps the ConstraintVertex instance as a NamedRole. 'links' & 'relates' constraints accept unscoped role names. Since an unscoped role-name does not uniquely identify a role-type, (Different role-types belonging to different relation types may share the same name) an internal variable is introduced to handle the ambiguity Will panic if the instance is not a NamedRole variant.
struct NamedRole*
constraint_vertex_as_value
struct Concept* constraint_vertex_as_value(const struct ConstraintVertex* vertex)
Unwraps the ConstraintVertex instance as a Value. Will panic if the instance is not a Value variant.
struct Concept*
constraint_vertex_as_variable
struct Variable* constraint_vertex_as_variable(const struct ConstraintVertex* vertex)
Unwraps the ConstraintVertex instance as a Variable. Will panic if the instance is not a Variable variant.
struct Variable*
constraintvertexiterator
variable
Struct Variable
class
Uniquely identifies a variable in a Pipelinepipeline. Its name (if any) can be retrieved from the variable_names field in Pipeline
variable_drop
void variable_drop(struct Variable* obj)
Frees the native rust Variable object.
void
variable_get_name
char* variable_get_name(const struct Pipeline* pipeline_structure, const struct Variable* variable)
Returns the name of the specified variable if it has one, and null otherwise. The Pipeline must be the one that contains the variable.
char*
variableannotations
variable_annotations_drop
void variable_annotations_drop(struct VariableAnnotations* obj)
Frees the native rust VariableAnnotations object.
void
variable_annotations_instance
struct ConceptIterator* variable_annotations_instance(const struct VariableAnnotations* annotations)
Unwraps the VariableAnnotations instance as annotations for an Instance variable, and returns the possible types of the instances the variable may hold. Will panic if the variable is not an Instance variable.
struct ConceptIterator*
variable_annotations_type
struct ConceptIterator* variable_annotations_type(const struct VariableAnnotations* annotations)
Unwraps the VariableAnnotations instance as annotations for a Type variable, and returns the possible types the variable may be. Will panic if the variable is not a Type variable.
struct ConceptIterator*
variable_annotations_value
struct StringIterator* variable_annotations_value(const struct VariableAnnotations* annotations)
Unwraps the VariableAnnotations instance as annotations for a Value variable, and returns the possible ValueTypes the value may be. Will panic if the variable is not a Value variable.
struct StringIterator*
variable_annotations_variant
enum VariableAnnotationsVariant variable_annotations_variant(const struct VariableAnnotations* annotations)
Returns the variant of the specified VariableAnnotations. This tells us whether the variable holds an instance, a type or a raw value.
enum VariableAnnotationsVariant
variableannotationsiterator
variable_annotations_iterator_drop
void variable_annotations_iterator_drop(struct VariableAnnotationsIterator* it)
Frees the native rust VariableAnnotationsIterator object.
void
variable_annotations_iterator_next
struct VariableAnnotations* variable_annotations_iterator_next(struct VariableAnnotationsIterator* it)
Forwards the VariableAnnotationsIterator and returns the next VariableAnnotations if it exists, or null if there are no more elements.
struct VariableAnnotations*
variableiterator
fetch
fetch_leaf_annotations
struct StringIterator* fetch_leaf_annotations(const struct Fetch* fetch)
Unwraps the Fetch instance as a Leaf variant, and returns an iterator over possible value types. Will panic if the instance is not a Leaf variant.
struct StringIterator*
fetch_list_element
struct Fetch* fetch_list_element(const struct Fetch* fetch)
Unwraps the Fetch instance as a List variant, and returns the Fetch for an element of the list. Will panic if the instance is not a List variant.
struct Fetch*
fetch_object_fields
struct StringIterator* fetch_object_fields(const struct Fetch* fetch)
Unwraps the Fetch instance as an Object variant, and returns the available fields. Will panic if the instance is not an Object variant.
struct StringIterator*
function
Struct Function
class
Holds a representation of the function, and the result of type-inference for each variable.
function_argument_annotations
struct VariableAnnotationsIterator* function_argument_annotations(const struct Function* function)
Returns the inferred type for each argument of the function.
struct VariableAnnotationsIterator*
function_argument_variables
struct VariableIterator* function_argument_variables(const struct Function* function)
Returns the Variables which are the arguments of the function.
struct VariableIterator*
function_body
struct Pipeline* function_body(const struct Function* function)
A representation of the Pipeline which forms the body of the function.
struct Pipeline*
function_drop
void function_drop(struct Function* obj)
Frees the native rust Function object.
void
functioniterator
returnoperation
return_operation_drop
void return_operation_drop(struct ReturnOperation* obj)
Frees the native rust ReturnOperation object.
void
return_operation_reducers
struct ReducerIterator* return_operation_reducers(const struct ReturnOperation* return_operation)
Unwraps the ReturnOperation instance as a Reduce variant, and returns the reducers applied. Will panic if the instance is not a Reduce variant.
struct ReducerIterator*
return_operation_single_selector
char* return_operation_single_selector(const struct ReturnOperation* return_operation)
Unwraps the ReturnOperation instance as a Single variant, and returns the selector applied. Will panic if the instance is not a Single variant.
char*
return_operation_single_variables
struct VariableIterator* return_operation_single_variables(const struct ReturnOperation* return_operation)
Unwraps the ReturnOperation instance as a Single variant, and returns the returned variables. Will panic if the instance is not a Single variant.
struct VariableIterator*
return_operation_stream_variables
struct VariableIterator* return_operation_stream_variables(const struct ReturnOperation* return_operation)
Unwraps the ReturnOperation instance as a Stream variant, and returns the returned variables. Will panic if the instance is not a Stream variant.
struct VariableIterator*
reducer
Struct Reducer
class
Representation of a reducer used either in a PipelineStage::Reduce or in a function’s ReturnOperation.
reducer_drop
void reducer_drop(struct Reducer* obj)
Frees the native rust Reducer object.
void
reduceriterator
reduceassignment
Struct ReduceAssignment
class
Representation of an assignment from a reduction in a PipelineStage::Reduce, such as reduce $c = sum($x);
reduce_assignment_drop
void reduce_assignment_drop(struct ReduceAssignment* obj)
Frees the native rust ReduceAssignment object.
void
reduceassignmentiterator
sortvariable
Struct SortVariable
class
The variable being sorted on and the ordering of the sort, as used in a PipelineStage::Sort, e.g. sort $v desc
sort_variable_drop
void sort_variable_drop(struct SortVariable* obj)
Frees the native rust SortVariable object.
void
sortvariableiterator
namedrole
Struct NamedRole
class
A NamedRole vertex is used in links & relates constraints, as multiple relations may have roles with the same name.
named_role_as_u32
uint32_t named_role_as_u32(const struct NamedRole* named_role)
Returns a u32 identifying the named role instance. Meant to be used to implement hash, equality etc.
uint32_t
named_role_drop
void named_role_drop(struct NamedRole* obj)
Frees the native rust NamedRole object.
void
named_role_get_name
char* named_role_get_name(const struct NamedRole* named_role)
Returns the role name associated with the NamedRole.
char*
Errors
error
check_error
bool check_error(void)
Checks if the error flag was set by the last operation. If true, the error can be retrieved using get_last_error(void)
bool
error_code
char* error_code(const struct Error* error)
Returns the error code of the Error object
char*