diff --git a/c/BUILD b/c/BUILD index 4d20eea9ec..4516acb556 100644 --- a/c/BUILD +++ b/c/BUILD @@ -38,6 +38,7 @@ rust_static_library( "@crates//:chrono", "@crates//:itertools", + "@crates//:env_logger", "@crates//:log", ], ) diff --git a/c/src/error.rs b/c/src/error.rs index 4481c4ed2a..aa598c1cea 100644 --- a/c/src/error.rs +++ b/c/src/error.rs @@ -21,7 +21,8 @@ use std::{cell::RefCell, ffi::c_char, ptr::null_mut}; -use log::trace; +use env_logger::Env; +use log::{trace, warn}; use typedb_driver::{Error, Result}; use super::memory::{free, release_optional, release_string}; @@ -30,6 +31,14 @@ thread_local! { static LAST_ERROR: RefCell> = RefCell::new(None); } +#[no_mangle] +pub extern "C" fn init_logging() { + const ENV_VAR: &str = "TYPEDB_DRIVER_LOG_LEVEL"; + if let Err(err) = env_logger::try_init_from_env(Env::new().filter(ENV_VAR)) { + warn!("{err}"); + } +} + fn ok_record(result: Result) -> Option { match result { Ok(value) => Some(value), diff --git a/c/swig/typedb_driver_java.swg b/c/swig/typedb_driver_java.swg index 398de760c2..96c96ba2c1 100644 --- a/c/swig/typedb_driver_java.swg +++ b/c/swig/typedb_driver_java.swg @@ -59,7 +59,7 @@ public static class Unchecked extends RuntimeException { Unchecked(Error e) { - super(e); + super(e.getMessage()); } } %} @@ -83,6 +83,8 @@ } } +%nojavaexception init_logging; + /* simple getters do not throw */ %nojavaexception options_new; %nojavaexception options_get_infer; diff --git a/c/swig/typedb_driver_python.swg b/c/swig/typedb_driver_python.swg index 8dd5c6bacb..7ca7da9647 100644 --- a/c/swig/typedb_driver_python.swg +++ b/c/swig/typedb_driver_python.swg @@ -98,6 +98,8 @@ static PyObject* PyExc_TypeDBDriverError; %pythoncode %{ TypeDBDriverExceptionNative = native_driver_python.TypeDBDriverExceptionNative + + native_driver_python.init_logging() %} /* ValueType* needs special handling */ diff --git a/dependencies/vaticle/repositories.bzl b/dependencies/vaticle/repositories.bzl index a634d6a9ad..9c19b22edb 100644 --- a/dependencies/vaticle/repositories.bzl +++ b/dependencies/vaticle/repositories.bzl @@ -25,7 +25,7 @@ def vaticle_dependencies(): git_repository( name = "vaticle_dependencies", remote = "https://github.com/vaticle/dependencies", - commit = "67a0602be830227247d31bb881029d752f05f9bb", # sync-marker: do not remove this comment, this is used for sync-dependencies by @vaticle_dependencies + commit = "d75f30de7902892b1d45015aefd20f06048b0458", # sync-marker: do not remove this comment, this is used for sync-dependencies by @vaticle_dependencies ) def vaticle_typedb_common(): diff --git a/java/common/NativeObject.java b/java/common/NativeObject.java index 83189e7507..d7a3961a23 100644 --- a/java/common/NativeObject.java +++ b/java/common/NativeObject.java @@ -24,9 +24,12 @@ import com.vaticle.typedb.driver.common.exception.ErrorMessage; import com.vaticle.typedb.driver.common.exception.TypeDBDriverException; +import static com.vaticle.typedb.driver.jni.typedb_driver.init_logging; + public abstract class NativeObject { static { Loader.loadNativeLibraries(); + init_logging(); } public final T nativeObject; diff --git a/java/common/exception/TypeDBDriverException.java b/java/common/exception/TypeDBDriverException.java index b392e1f392..ea1043ad0a 100644 --- a/java/common/exception/TypeDBDriverException.java +++ b/java/common/exception/TypeDBDriverException.java @@ -28,9 +28,6 @@ */ public class TypeDBDriverException extends RuntimeException { - @Nullable - private final com.vaticle.typedb.driver.jni.Error nativeError; - @Nullable private final ErrorMessage errorMessage; @@ -40,7 +37,6 @@ public class TypeDBDriverException extends RuntimeException { public TypeDBDriverException(ErrorMessage error, Object... parameters) { super(error.message(parameters)); assert !getMessage().contains("%s"); - this.nativeError = null; this.errorMessage = error; } @@ -49,7 +45,6 @@ public TypeDBDriverException(ErrorMessage error, Object... parameters) { */ public TypeDBDriverException(String message, Throwable cause) { super(message, cause); - this.nativeError = null; this.errorMessage = null; } @@ -59,8 +54,6 @@ public TypeDBDriverException(String message, Throwable cause) { public TypeDBDriverException(RuntimeException error) { super(error.getMessage()); assert !getMessage().contains("%s"); - if (error.getCause() instanceof com.vaticle.typedb.driver.jni.Error) this.nativeError = (com.vaticle.typedb.driver.jni.Error)error.getCause(); - else this.nativeError = null; this.errorMessage = null; } @@ -70,7 +63,6 @@ public TypeDBDriverException(RuntimeException error) { public TypeDBDriverException(com.vaticle.typedb.driver.jni.Error error) { super(error.getMessage()); assert !getMessage().contains("%s"); - this.nativeError = error; this.errorMessage = null; } diff --git a/rust/docs/concept/ConceptManager.adoc b/rust/docs/concept/ConceptManager.adoc index 2df92c28b1..1bdc9aca59 100644 --- a/rust/docs/concept/ConceptManager.adoc +++ b/rust/docs/concept/ConceptManager.adoc @@ -336,7 +336,7 @@ transaction.concepts().get_relation_type(label).resolve() ---- pub fn get_schema_exceptions( &self -) -> Result>> +) -> Result> + 'tx> ---- Retrieves a list of all schema exceptions for the current transaction. @@ -345,7 +345,7 @@ Retrieves a list of all schema exceptions for the current transaction. .Returns [source,rust] ---- -Result>> +Result> + 'tx> ---- [caption=""] diff --git a/rust/docs/data/Attribute.adoc b/rust/docs/data/Attribute.adoc index 9daeac318b..6a759d53f7 100644 --- a/rust/docs/data/Attribute.adoc +++ b/rust/docs/data/Attribute.adoc @@ -33,8 +33,8 @@ a| `value` a| `Value` a| The value which this Attribute instance holds. [source,rust] ---- fn delete<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx> + &self, + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -52,12 +52,12 @@ BoxPromise<'tx, Result> [source,rust] ---- -fn get_has( +fn get_has<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, attribute_types: Vec, annotations: Vec -) -> Result>> +) -> Result>> ---- <<#_trait_ThingAPI_method_get_has,Read more>> @@ -66,7 +66,7 @@ fn get_has( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_Attribute_method_get_owners] @@ -74,11 +74,11 @@ Result>> [source,rust] ---- -fn get_owners( +fn get_owners<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, thing_type: Option -) -> Result>> +) -> Result>> ---- <<#_trait_AttributeAPI_method_get_owners,Read more>> @@ -87,7 +87,7 @@ fn get_owners( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_Attribute_method_get_playing] @@ -95,10 +95,10 @@ Result>> [source,rust] ---- -fn get_playing( +fn get_playing<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- <<#_trait_ThingAPI_method_get_playing,Read more>> @@ -107,7 +107,7 @@ fn get_playing( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_Attribute_method_get_relations] @@ -115,11 +115,11 @@ Result>> [source,rust] ---- -fn get_relations( +fn get_relations<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, role_types: Vec -) -> Result>> +) -> Result>> ---- <<#_trait_ThingAPI_method_get_relations,Read more>> @@ -128,7 +128,7 @@ fn get_relations( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_Attribute_tymethod_iid] @@ -154,8 +154,8 @@ fn iid(&self) -> &IID [source,rust] ---- fn is_deleted<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx> + &self, + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -191,8 +191,8 @@ bool [source,rust] ---- fn set_has<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx>, + &self, + transaction: &'tx Transaction<'_>, attribute: Attribute ) -> BoxPromise<'tx, Result> ---- @@ -212,8 +212,8 @@ BoxPromise<'tx, Result> [source,rust] ---- fn unset_has<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx>, + &self, + transaction: &'tx Transaction<'_>, attribute: Attribute ) -> BoxPromise<'tx, Result> ---- diff --git a/rust/docs/data/Entity.adoc b/rust/docs/data/Entity.adoc index 240c17eb76..25ec85b55e 100644 --- a/rust/docs/data/Entity.adoc +++ b/rust/docs/data/Entity.adoc @@ -34,8 +34,8 @@ a| `type_` a| `EntityType` a| The type which this Entity belongs to [source,rust] ---- fn delete<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx> + &self, + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -53,12 +53,12 @@ BoxPromise<'tx, Result> [source,rust] ---- -fn get_has( +fn get_has<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, attribute_types: Vec, annotations: Vec -) -> Result>> +) -> Result>> ---- <<#_trait_ThingAPI_method_get_has,Read more>> @@ -67,7 +67,7 @@ fn get_has( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_Entity_method_get_playing] @@ -75,10 +75,10 @@ Result>> [source,rust] ---- -fn get_playing( +fn get_playing<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- <<#_trait_ThingAPI_method_get_playing,Read more>> @@ -87,7 +87,7 @@ fn get_playing( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_Entity_method_get_relations] @@ -95,11 +95,11 @@ Result>> [source,rust] ---- -fn get_relations( +fn get_relations<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, role_types: Vec -) -> Result>> +) -> Result>> ---- <<#_trait_ThingAPI_method_get_relations,Read more>> @@ -108,7 +108,7 @@ fn get_relations( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_Entity_tymethod_iid] @@ -134,8 +134,8 @@ fn iid(&self) -> &IID [source,rust] ---- fn is_deleted<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx> + &self, + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -171,8 +171,8 @@ bool [source,rust] ---- fn set_has<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx>, + &self, + transaction: &'tx Transaction<'_>, attribute: Attribute ) -> BoxPromise<'tx, Result> ---- @@ -192,8 +192,8 @@ BoxPromise<'tx, Result> [source,rust] ---- fn unset_has<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx>, + &self, + transaction: &'tx Transaction<'_>, attribute: Attribute ) -> BoxPromise<'tx, Result> ---- diff --git a/rust/docs/data/Relation.adoc b/rust/docs/data/Relation.adoc index 049ddc3edf..0e7da372e2 100644 --- a/rust/docs/data/Relation.adoc +++ b/rust/docs/data/Relation.adoc @@ -34,8 +34,8 @@ a| `type_` a| `RelationType` a| The type which this Relation belongs to [source,rust] ---- fn add_role_player<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx>, + &self, + transaction: &'tx Transaction<'_>, role_type: RoleType, player: Thing ) -> BoxPromise<'tx, Result> @@ -56,8 +56,8 @@ BoxPromise<'tx, Result> [source,rust] ---- fn delete<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx> + &self, + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -75,12 +75,12 @@ BoxPromise<'tx, Result> [source,rust] ---- -fn get_has( +fn get_has<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, attribute_types: Vec, annotations: Vec -) -> Result>> +) -> Result>> ---- <<#_trait_ThingAPI_method_get_has,Read more>> @@ -89,7 +89,7 @@ fn get_has( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_Relation_method_get_players_by_role_type] @@ -97,11 +97,11 @@ Result>> [source,rust] ---- -fn get_players_by_role_type( +fn get_players_by_role_type<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, role_types: Vec -) -> Result>> +) -> Result>> ---- <<#_trait_RelationAPI_method_get_players_by_role_type,Read more>> @@ -110,7 +110,7 @@ fn get_players_by_role_type( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_Relation_method_get_playing] @@ -118,10 +118,10 @@ Result>> [source,rust] ---- -fn get_playing( +fn get_playing<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- <<#_trait_ThingAPI_method_get_playing,Read more>> @@ -130,7 +130,7 @@ fn get_playing( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_Relation_method_get_relating] @@ -138,10 +138,10 @@ Result>> [source,rust] ---- -fn get_relating( +fn get_relating<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- <<#_trait_RelationAPI_method_get_relating,Read more>> @@ -150,7 +150,7 @@ fn get_relating( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_Relation_method_get_relations] @@ -158,11 +158,11 @@ Result>> [source,rust] ---- -fn get_relations( +fn get_relations<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, role_types: Vec -) -> Result>> +) -> Result>> ---- <<#_trait_ThingAPI_method_get_relations,Read more>> @@ -171,7 +171,7 @@ fn get_relations( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_Relation_method_get_role_players] @@ -179,10 +179,10 @@ Result>> [source,rust] ---- -fn get_role_players( +fn get_role_players<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- <<#_trait_RelationAPI_method_get_role_players,Read more>> @@ -191,7 +191,7 @@ fn get_role_players( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_Relation_tymethod_iid] @@ -217,8 +217,8 @@ fn iid(&self) -> &IID [source,rust] ---- fn is_deleted<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx> + &self, + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -254,8 +254,8 @@ bool [source,rust] ---- fn remove_role_player<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx>, + &self, + transaction: &'tx Transaction<'_>, role_type: RoleType, player: Thing ) -> BoxPromise<'tx, Result> @@ -276,8 +276,8 @@ BoxPromise<'tx, Result> [source,rust] ---- fn set_has<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx>, + &self, + transaction: &'tx Transaction<'_>, attribute: Attribute ) -> BoxPromise<'tx, Result> ---- @@ -297,8 +297,8 @@ BoxPromise<'tx, Result> [source,rust] ---- fn unset_has<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx>, + &self, + transaction: &'tx Transaction<'_>, attribute: Attribute ) -> BoxPromise<'tx, Result> ---- diff --git a/rust/docs/data/Trait_AttributeAPI.adoc b/rust/docs/data/Trait_AttributeAPI.adoc index 5fae33b48b..5936ac6bcb 100644 --- a/rust/docs/data/Trait_AttributeAPI.adoc +++ b/rust/docs/data/Trait_AttributeAPI.adoc @@ -11,11 +11,11 @@ [source,rust] ---- -fn get_owners( +fn get_owners<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, thing_type: Option -) -> Result>> +) -> Result>> ---- Retrieves the instances that own this ``Attribute``. @@ -26,7 +26,7 @@ Retrieves the instances that own this ``Attribute``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `owner_type` a| If specified, filter results for only owners of the given type a| |=== @@ -34,7 +34,7 @@ a| `owner_type` a| If specified, filter results for only owners of the given typ .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] diff --git a/rust/docs/data/Trait_RelationAPI.adoc b/rust/docs/data/Trait_RelationAPI.adoc index 5892244314..f7b0586aea 100644 --- a/rust/docs/data/Trait_RelationAPI.adoc +++ b/rust/docs/data/Trait_RelationAPI.adoc @@ -12,8 +12,8 @@ [source,rust] ---- fn add_role_player<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx>, + &self, + transaction: &'tx Transaction<'_>, role_type: RoleType, player: Thing ) -> BoxPromise<'tx, Result> @@ -27,7 +27,7 @@ Adds a new role player to play the given role in this ``Relation``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `role_type` a| The role to be played by the ``player`` a| `RoleType` a| `player` a| The thing to play the role a| `Thing` |=== @@ -69,11 +69,11 @@ relation.add_role_player(transaction, role_type, player).resolve(); [source,rust] ---- -fn get_players_by_role_type( +fn get_players_by_role_type<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, role_types: Vec -) -> Result>> +) -> Result>> ---- Retrieves all role players of this ``Relation``, optionally filtered by given role types. @@ -84,7 +84,7 @@ Retrieves all role players of this ``Relation``, optionally filtered by given ro [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `role_types` a| 0 or more role types a| `Vec` |=== @@ -92,7 +92,7 @@ a| `role_types` a| 0 or more role types a| `Vec` .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -107,10 +107,10 @@ relation.get_players_by_role_type(transaction, role_types); [source,rust] ---- -fn get_relating( +fn get_relating<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- Retrieves all role types currently played in this ``Relation``. @@ -121,14 +121,14 @@ Retrieves all role types currently played in this ``Relation``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -143,10 +143,10 @@ relation.get_relating(transaction) [source,rust] ---- -fn get_role_players( +fn get_role_players<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- Retrieves a mapping of all instances involved in the ``Relation`` and the role each play. @@ -157,15 +157,15 @@ Retrieves a mapping of all instances involved in the ``Relation`` and the role e [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_> -) -> Result +) -> Result>> +Result>> ---- [caption=""] @@ -181,8 +181,8 @@ relation.get_role_players(transaction) [source,rust] ---- fn remove_role_player<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx>, + &self, + transaction: &'tx Transaction<'_>, role_type: RoleType, player: Thing ) -> BoxPromise<'tx, Result> @@ -196,7 +196,7 @@ Removes the association of the given instance that plays the given role in this [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `role_type` a| The role to no longer be played by the thing in this ``Relation`` a| `RoleType` a| `player` a| The instance to no longer play the role in this ``Relation`` a| `Thing` |=== diff --git a/rust/docs/data/Trait_ThingAPI.adoc b/rust/docs/data/Trait_ThingAPI.adoc index ff85c9aaa4..09da8b9fae 100644 --- a/rust/docs/data/Trait_ThingAPI.adoc +++ b/rust/docs/data/Trait_ThingAPI.adoc @@ -14,8 +14,8 @@ [source,rust] ---- fn delete<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx> + &self, + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -27,7 +27,7 @@ Deletes this ``Thing``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -67,12 +67,12 @@ thing.delete(transaction).resolve(); [source,rust] ---- -fn get_has( +fn get_has<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, attribute_types: Vec, annotations: Vec -) -> Result>> +) -> Result>> ---- Retrieves the ``Attribute``s that this ``Thing`` owns. Optionally, filtered by an ``AttributeType`` or a list of ``AttributeType``s. Optionally, filtered by ``Annotation``s. @@ -83,7 +83,7 @@ Retrieves the ``Attribute``s that this ``Thing`` owns. Optionally, filtered by a [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `attribute_type` a| The ``AttributeType`` to filter the attributes by a| a| `attribute_types` a| The ``AttributeType``s to filter the attributes by a| `Vec` a| `annotations` a| Only retrieve attributes with all given ``Annotation``s a| `Vec` @@ -93,7 +93,7 @@ a| `annotations` a| Only retrieve attributes with all given ``Annotation``s a| ` .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -108,10 +108,10 @@ thing.get_has(transaction, attribute_type, annotations=vec![Annotation::Key]); [source,rust] ---- -fn get_playing( +fn get_playing<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- Retrieves the roles that this ``Thing`` is currently playing. @@ -122,14 +122,14 @@ Retrieves the roles that this ``Thing`` is currently playing. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -144,11 +144,11 @@ thing.get_playing(transaction); [source,rust] ---- -fn get_relations( +fn get_relations<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, role_types: Vec -) -> Result>> +) -> Result>> ---- Retrieves all the ``Relations`` which this ``Thing`` plays a role in, optionally filtered by one or more given roles. @@ -159,7 +159,7 @@ Retrieves all the ``Relations`` which this ``Thing`` plays a role in, optionally [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `role_types` a| The list of roles to filter the relations by. a| `Vec` |=== @@ -167,7 +167,7 @@ a| `role_types` a| The list of roles to filter the relations by. a| `Vec>> +Result>> ---- [caption=""] @@ -207,8 +207,8 @@ thing.iid(); [source,rust] ---- fn is_deleted<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx> + &self, + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -220,7 +220,7 @@ Checks if this ``Thing`` is deleted. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -285,8 +285,8 @@ thing.is_inferred(); [source,rust] ---- fn set_has<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx>, + &self, + transaction: &'tx Transaction<'_>, attribute: Attribute ) -> BoxPromise<'tx, Result> ---- @@ -299,7 +299,7 @@ Assigns an ``Attribute`` to be owned by this ``Thing``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `attribute` a| The ``Attribute`` to be owned by this ``Thing``. a| `Attribute` |=== @@ -341,8 +341,8 @@ thing.set_has(transaction, attribute).resolve(); [source,rust] ---- fn unset_has<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx>, + &self, + transaction: &'tx Transaction<'_>, attribute: Attribute ) -> BoxPromise<'tx, Result> ---- @@ -355,7 +355,7 @@ Unassigns an ``Attribute`` from this ``Thing``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `attribute` a| The ``Attribute`` to be disowned from this ``Thing``. a| `Attribute` |=== diff --git a/rust/docs/logic/LogicManager.adoc b/rust/docs/logic/LogicManager.adoc index f05a8d1715..08602da04a 100644 --- a/rust/docs/logic/LogicManager.adoc +++ b/rust/docs/logic/LogicManager.adoc @@ -65,7 +65,7 @@ transaction.logic().get_rule(label).resolve() [source,rust] ---- -pub fn get_rules(&self) -> Result>> +pub fn get_rules(&self) -> Result> + 'tx> ---- Retrieves all rules. @@ -74,7 +74,7 @@ Retrieves all rules. .Returns [source,rust] ---- -Result>> +Result> + 'tx> ---- [caption=""] diff --git a/rust/docs/schema/AttributeType.adoc b/rust/docs/schema/AttributeType.adoc index 791f3536b3..ab74e1683f 100644 --- a/rust/docs/schema/AttributeType.adoc +++ b/rust/docs/schema/AttributeType.adoc @@ -40,7 +40,7 @@ a| `value_type` a| `ValueType` a| ---- fn delete<'tx>( &mut self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -60,7 +60,7 @@ BoxPromise<'tx, Result> ---- fn get<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, value: Value ) -> BoxPromise<'tx, Result>> ---- @@ -79,11 +79,11 @@ BoxPromise<'tx, Result>> [source,rust] ---- -fn get_instances( +fn get_instances<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- <<#_trait_AttributeTypeAPI_method_get_instances,Read more>> @@ -92,7 +92,7 @@ fn get_instances( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_AttributeType_method_get_owners] @@ -100,12 +100,12 @@ Result>> [source,rust] ---- -fn get_owners( +fn get_owners<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity, annotations: Vec -) -> Result>> +) -> Result>> ---- <<#_trait_AttributeTypeAPI_method_get_owners,Read more>> @@ -114,7 +114,7 @@ fn get_owners( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_AttributeType_method_get_owns] @@ -122,13 +122,13 @@ Result>> [source,rust] ---- -fn get_owns( +fn get_owns<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, value_type: Option, transitivity: Transitivity, annotations: Vec -) -> Result>> +) -> Result>> ---- <<#_trait_ThingTypeAPI_method_get_owns,Read more>> @@ -137,7 +137,7 @@ fn get_owns( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_AttributeType_method_get_owns_overridden] @@ -147,7 +147,7 @@ Result>> ---- fn get_owns_overridden<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, overridden_attribute_type: AttributeType ) -> BoxPromise<'tx, Result>> ---- @@ -166,11 +166,11 @@ BoxPromise<'tx, Result>> [source,rust] ---- -fn get_plays( +fn get_plays<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- <<#_trait_ThingTypeAPI_method_get_plays,Read more>> @@ -179,7 +179,7 @@ fn get_plays( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_AttributeType_method_get_plays_overridden] @@ -189,7 +189,7 @@ Result>> ---- fn get_plays_overridden<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, overridden_role_type: RoleType ) -> BoxPromise<'tx, Result>> ---- @@ -210,7 +210,7 @@ BoxPromise<'tx, Result>> ---- fn get_regex<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result>> ---- @@ -228,11 +228,11 @@ BoxPromise<'tx, Result>> [source,rust] ---- -fn get_subtypes( +fn get_subtypes<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- <<#_trait_AttributeTypeAPI_method_get_subtypes,Read more>> @@ -241,7 +241,7 @@ fn get_subtypes( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_AttributeType_method_get_subtypes_with_value_type] @@ -249,12 +249,12 @@ Result>> [source,rust] ---- -fn get_subtypes_with_value_type( +fn get_subtypes_with_value_type<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, value_type: ValueType, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- <<#_trait_AttributeTypeAPI_method_get_subtypes_with_value_type,Read more>> @@ -263,7 +263,7 @@ fn get_subtypes_with_value_type( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_AttributeType_method_get_supertype] @@ -273,7 +273,7 @@ Result>> ---- fn get_supertype<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result>> ---- @@ -291,10 +291,10 @@ BoxPromise<'tx, Result>> [source,rust] ---- -fn get_supertypes( +fn get_supertypes<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- <<#_trait_AttributeTypeAPI_method_get_supertypes,Read more>> @@ -303,7 +303,7 @@ fn get_supertypes( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_AttributeType_method_get_syntax] @@ -313,7 +313,7 @@ Result>> ---- fn get_syntax<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -350,7 +350,7 @@ bool ---- fn is_deleted<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -404,7 +404,7 @@ fn label(&self) -> &str ---- fn put<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, value: Value ) -> BoxPromise<'tx, Result> ---- @@ -442,7 +442,7 @@ Self ---- fn set_abstract<'tx>( &mut self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -462,7 +462,7 @@ BoxPromise<'tx, Result> ---- fn set_label<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, new_label: String ) -> BoxPromise<'tx, Result> ---- @@ -483,7 +483,7 @@ BoxPromise<'tx, Result> ---- fn set_owns<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, attribute_type: AttributeType, overridden_attribute_type: Option, annotations: Vec @@ -506,7 +506,7 @@ BoxPromise<'tx, Result> ---- fn set_plays<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_type: RoleType, overridden_role_type: Option ) -> BoxPromise<'tx, Result> @@ -528,7 +528,7 @@ BoxPromise<'tx, Result> ---- fn set_regex<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, regex: String ) -> BoxPromise<'tx, Result> ---- @@ -549,7 +549,7 @@ BoxPromise<'tx, Result> ---- fn set_supertype<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, supertype: AttributeType ) -> BoxPromise<'tx, Result> ---- @@ -570,7 +570,7 @@ BoxPromise<'tx, Result> ---- fn unset_abstract<'tx>( &mut self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -590,7 +590,7 @@ BoxPromise<'tx, Result> ---- fn unset_owns<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, attribute_type: AttributeType ) -> BoxPromise<'tx, Result> ---- @@ -611,7 +611,7 @@ BoxPromise<'tx, Result> ---- fn unset_plays<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_type: RoleType ) -> BoxPromise<'tx, Result> ---- @@ -632,7 +632,7 @@ BoxPromise<'tx, Result> ---- fn unset_regex<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- diff --git a/rust/docs/schema/EntityType.adoc b/rust/docs/schema/EntityType.adoc index a0f15e9f24..3895c6c63b 100644 --- a/rust/docs/schema/EntityType.adoc +++ b/rust/docs/schema/EntityType.adoc @@ -35,7 +35,7 @@ a| `label` a| `String` a| ---- fn create<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -55,7 +55,7 @@ BoxPromise<'tx, Result> ---- fn delete<'tx>( &mut self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -73,11 +73,11 @@ BoxPromise<'tx, Result> [source,rust] ---- -fn get_instances( +fn get_instances<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- <<#_trait_EntityTypeAPI_method_get_instances,Read more>> @@ -86,7 +86,7 @@ fn get_instances( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_EntityType_method_get_owns] @@ -94,13 +94,13 @@ Result>> [source,rust] ---- -fn get_owns( +fn get_owns<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, value_type: Option, transitivity: Transitivity, annotations: Vec -) -> Result>> +) -> Result>> ---- <<#_trait_ThingTypeAPI_method_get_owns,Read more>> @@ -109,7 +109,7 @@ fn get_owns( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_EntityType_method_get_owns_overridden] @@ -119,7 +119,7 @@ Result>> ---- fn get_owns_overridden<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, overridden_attribute_type: AttributeType ) -> BoxPromise<'tx, Result>> ---- @@ -138,11 +138,11 @@ BoxPromise<'tx, Result>> [source,rust] ---- -fn get_plays( +fn get_plays<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- <<#_trait_ThingTypeAPI_method_get_plays,Read more>> @@ -151,7 +151,7 @@ fn get_plays( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_EntityType_method_get_plays_overridden] @@ -161,7 +161,7 @@ Result>> ---- fn get_plays_overridden<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, overridden_role_type: RoleType ) -> BoxPromise<'tx, Result>> ---- @@ -180,11 +180,11 @@ BoxPromise<'tx, Result>> [source,rust] ---- -fn get_subtypes( +fn get_subtypes<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- <<#_trait_EntityTypeAPI_method_get_subtypes,Read more>> @@ -193,7 +193,7 @@ fn get_subtypes( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_EntityType_method_get_supertype] @@ -203,7 +203,7 @@ Result>> ---- fn get_supertype<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result>> ---- @@ -221,10 +221,10 @@ BoxPromise<'tx, Result>> [source,rust] ---- -fn get_supertypes( +fn get_supertypes<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- <<#_trait_EntityTypeAPI_method_get_supertypes,Read more>> @@ -233,7 +233,7 @@ fn get_supertypes( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_EntityType_method_get_syntax] @@ -243,7 +243,7 @@ Result>> ---- fn get_syntax<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -280,7 +280,7 @@ bool ---- fn is_deleted<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -351,7 +351,7 @@ Self ---- fn set_abstract<'tx>( &mut self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -371,7 +371,7 @@ BoxPromise<'tx, Result> ---- fn set_label<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, new_label: String ) -> BoxPromise<'tx, Result> ---- @@ -392,7 +392,7 @@ BoxPromise<'tx, Result> ---- fn set_owns<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, attribute_type: AttributeType, overridden_attribute_type: Option, annotations: Vec @@ -415,7 +415,7 @@ BoxPromise<'tx, Result> ---- fn set_plays<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_type: RoleType, overridden_role_type: Option ) -> BoxPromise<'tx, Result> @@ -437,7 +437,7 @@ BoxPromise<'tx, Result> ---- fn set_supertype<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, supertype: EntityType ) -> BoxPromise<'tx, Result> ---- @@ -458,7 +458,7 @@ BoxPromise<'tx, Result> ---- fn unset_abstract<'tx>( &mut self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -478,7 +478,7 @@ BoxPromise<'tx, Result> ---- fn unset_owns<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, attribute_type: AttributeType ) -> BoxPromise<'tx, Result> ---- @@ -499,7 +499,7 @@ BoxPromise<'tx, Result> ---- fn unset_plays<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_type: RoleType ) -> BoxPromise<'tx, Result> ---- diff --git a/rust/docs/schema/RelationType.adoc b/rust/docs/schema/RelationType.adoc index 9978ca4bd5..98028ab68b 100644 --- a/rust/docs/schema/RelationType.adoc +++ b/rust/docs/schema/RelationType.adoc @@ -39,7 +39,7 @@ a| `label` a| `String` a| ---- fn create<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -59,7 +59,7 @@ BoxPromise<'tx, Result> ---- fn delete<'tx>( &mut self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -77,11 +77,11 @@ BoxPromise<'tx, Result> [source,rust] ---- -fn get_instances( +fn get_instances<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- <<#_trait_RelationTypeAPI_method_get_instances,Read more>> @@ -90,7 +90,7 @@ fn get_instances( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_RelationType_method_get_owns] @@ -98,13 +98,13 @@ Result>> [source,rust] ---- -fn get_owns( +fn get_owns<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, value_type: Option, transitivity: Transitivity, annotations: Vec -) -> Result>> +) -> Result>> ---- <<#_trait_ThingTypeAPI_method_get_owns,Read more>> @@ -113,7 +113,7 @@ fn get_owns( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_RelationType_method_get_owns_overridden] @@ -123,7 +123,7 @@ Result>> ---- fn get_owns_overridden<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, overridden_attribute_type: AttributeType ) -> BoxPromise<'tx, Result>> ---- @@ -142,11 +142,11 @@ BoxPromise<'tx, Result>> [source,rust] ---- -fn get_plays( +fn get_plays<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- <<#_trait_ThingTypeAPI_method_get_plays,Read more>> @@ -155,7 +155,7 @@ fn get_plays( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_RelationType_method_get_plays_overridden] @@ -165,7 +165,7 @@ Result>> ---- fn get_plays_overridden<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, overridden_role_type: RoleType ) -> BoxPromise<'tx, Result>> ---- @@ -184,11 +184,11 @@ BoxPromise<'tx, Result>> [source,rust] ---- -fn get_relates( +fn get_relates<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- <<#_trait_RelationTypeAPI_method_get_relates,Read more>> @@ -197,7 +197,7 @@ fn get_relates( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_RelationType_method_get_relates_for_role_label] @@ -207,7 +207,7 @@ Result>> ---- fn get_relates_for_role_label<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_label: String ) -> BoxPromise<'tx, Result>> ---- @@ -228,7 +228,7 @@ BoxPromise<'tx, Result>> ---- fn get_relates_overridden<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, overridden_role_label: String ) -> BoxPromise<'tx, Result>> ---- @@ -247,11 +247,11 @@ BoxPromise<'tx, Result>> [source,rust] ---- -fn get_subtypes( +fn get_subtypes<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- <<#_trait_RelationTypeAPI_method_get_subtypes,Read more>> @@ -260,7 +260,7 @@ fn get_subtypes( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_RelationType_method_get_supertype] @@ -270,7 +270,7 @@ Result>> ---- fn get_supertype<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result>> ---- @@ -288,10 +288,10 @@ BoxPromise<'tx, Result>> [source,rust] ---- -fn get_supertypes( +fn get_supertypes<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- <<#_trait_RelationTypeAPI_method_get_supertypes,Read more>> @@ -300,7 +300,7 @@ fn get_supertypes( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_RelationType_method_get_syntax] @@ -310,7 +310,7 @@ Result>> ---- fn get_syntax<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -347,7 +347,7 @@ bool ---- fn is_deleted<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -418,7 +418,7 @@ Self ---- fn set_abstract<'tx>( &mut self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -438,7 +438,7 @@ BoxPromise<'tx, Result> ---- fn set_label<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, new_label: String ) -> BoxPromise<'tx, Result> ---- @@ -459,7 +459,7 @@ BoxPromise<'tx, Result> ---- fn set_owns<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, attribute_type: AttributeType, overridden_attribute_type: Option, annotations: Vec @@ -482,7 +482,7 @@ BoxPromise<'tx, Result> ---- fn set_plays<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_type: RoleType, overridden_role_type: Option ) -> BoxPromise<'tx, Result> @@ -504,7 +504,7 @@ BoxPromise<'tx, Result> ---- fn set_relates<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_label: String, overridden_role_label: Option ) -> BoxPromise<'tx, Result> @@ -526,7 +526,7 @@ BoxPromise<'tx, Result> ---- fn set_supertype<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, supertype: RelationType ) -> BoxPromise<'tx, Result> ---- @@ -547,7 +547,7 @@ BoxPromise<'tx, Result> ---- fn unset_abstract<'tx>( &mut self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -567,7 +567,7 @@ BoxPromise<'tx, Result> ---- fn unset_owns<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, attribute_type: AttributeType ) -> BoxPromise<'tx, Result> ---- @@ -588,7 +588,7 @@ BoxPromise<'tx, Result> ---- fn unset_plays<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_type: RoleType ) -> BoxPromise<'tx, Result> ---- @@ -609,7 +609,7 @@ BoxPromise<'tx, Result> ---- fn unset_relates<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_label: String ) -> BoxPromise<'tx, Result> ---- diff --git a/rust/docs/schema/RoleType.adoc b/rust/docs/schema/RoleType.adoc index 1132bc4373..0fea42d386 100644 --- a/rust/docs/schema/RoleType.adoc +++ b/rust/docs/schema/RoleType.adoc @@ -36,7 +36,7 @@ a| `label` a| `ScopedLabel` a| ---- fn delete<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -54,11 +54,11 @@ BoxPromise<'tx, Result> [source,rust] ---- -fn get_player_instances( +fn get_player_instances<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- <<#_trait_RoleTypeAPI_method_get_player_instances,Read more>> @@ -67,7 +67,7 @@ fn get_player_instances( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_RoleType_method_get_player_types] @@ -75,11 +75,11 @@ Result>> [source,rust] ---- -fn get_player_types( +fn get_player_types<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- <<#_trait_RoleTypeAPI_method_get_player_types,Read more>> @@ -88,7 +88,7 @@ fn get_player_types( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_RoleType_method_get_relation_instances] @@ -96,11 +96,11 @@ Result>> [source,rust] ---- -fn get_relation_instances( +fn get_relation_instances<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- <<#_trait_RoleTypeAPI_method_get_relation_instances,Read more>> @@ -109,7 +109,7 @@ fn get_relation_instances( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_RoleType_tymethod_get_relation_type] @@ -119,7 +119,7 @@ Result>> ---- fn get_relation_type<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result>> ---- @@ -137,10 +137,10 @@ BoxPromise<'tx, Result>> [source,rust] ---- -fn get_relation_types( +fn get_relation_types<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- <<#_trait_RoleTypeAPI_method_get_relation_types,Read more>> @@ -149,7 +149,7 @@ fn get_relation_types( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_RoleType_method_get_subtypes] @@ -157,11 +157,11 @@ Result>> [source,rust] ---- -fn get_subtypes( +fn get_subtypes<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- <<#_trait_RoleTypeAPI_method_get_subtypes,Read more>> @@ -170,7 +170,7 @@ fn get_subtypes( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_RoleType_method_get_supertype] @@ -180,7 +180,7 @@ Result>> ---- fn get_supertype<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result>> ---- @@ -198,10 +198,10 @@ BoxPromise<'tx, Result>> [source,rust] ---- -fn get_supertypes( +fn get_supertypes<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- <<#_trait_RoleTypeAPI_method_get_supertypes,Read more>> @@ -210,7 +210,7 @@ fn get_supertypes( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_RoleType_tymethod_is_abstract] @@ -237,7 +237,7 @@ bool ---- fn is_deleted<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -257,7 +257,7 @@ BoxPromise<'tx, Result> ---- fn set_label<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, new_label: String ) -> BoxPromise<'tx, Result> ---- diff --git a/rust/docs/schema/RootThingType.adoc b/rust/docs/schema/RootThingType.adoc index c809456336..59784f2978 100644 --- a/rust/docs/schema/RootThingType.adoc +++ b/rust/docs/schema/RootThingType.adoc @@ -19,7 +19,7 @@ ---- fn delete<'tx>( &mut self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -37,13 +37,13 @@ BoxPromise<'tx, Result> [source,rust] ---- -fn get_owns( +fn get_owns<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, value_type: Option, transitivity: Transitivity, annotations: Vec -) -> Result>> +) -> Result>> ---- <<#_trait_ThingTypeAPI_method_get_owns,Read more>> @@ -52,7 +52,7 @@ fn get_owns( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_RootThingType_method_get_owns_overridden] @@ -62,7 +62,7 @@ Result>> ---- fn get_owns_overridden<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, overridden_attribute_type: AttributeType ) -> BoxPromise<'tx, Result>> ---- @@ -81,11 +81,11 @@ BoxPromise<'tx, Result>> [source,rust] ---- -fn get_plays( +fn get_plays<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- <<#_trait_ThingTypeAPI_method_get_plays,Read more>> @@ -94,7 +94,7 @@ fn get_plays( .Returns [source,rust] ---- -Result>> +Result>> ---- [#_struct_RootThingType_method_get_plays_overridden] @@ -104,7 +104,7 @@ Result>> ---- fn get_plays_overridden<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, overridden_role_type: RoleType ) -> BoxPromise<'tx, Result>> ---- @@ -125,7 +125,7 @@ BoxPromise<'tx, Result>> ---- fn get_syntax<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -162,7 +162,7 @@ bool ---- fn is_deleted<'tx>( &self, - _transaction: &Transaction<'tx> + _transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -216,7 +216,7 @@ fn label(&self) -> &str ---- fn set_abstract<'tx>( &mut self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -236,7 +236,7 @@ BoxPromise<'tx, Result> ---- fn set_label<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, new_label: String ) -> BoxPromise<'tx, Result> ---- @@ -257,7 +257,7 @@ BoxPromise<'tx, Result> ---- fn set_owns<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, attribute_type: AttributeType, overridden_attribute_type: Option, annotations: Vec @@ -280,7 +280,7 @@ BoxPromise<'tx, Result> ---- fn set_plays<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_type: RoleType, overridden_role_type: Option ) -> BoxPromise<'tx, Result> @@ -302,7 +302,7 @@ BoxPromise<'tx, Result> ---- fn unset_abstract<'tx>( &mut self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -322,7 +322,7 @@ BoxPromise<'tx, Result> ---- fn unset_owns<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, attribute_type: AttributeType ) -> BoxPromise<'tx, Result> ---- @@ -343,7 +343,7 @@ BoxPromise<'tx, Result> ---- fn unset_plays<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_type: RoleType ) -> BoxPromise<'tx, Result> ---- diff --git a/rust/docs/schema/Trait_AttributeTypeAPI.adoc b/rust/docs/schema/Trait_AttributeTypeAPI.adoc index c577e2a5b4..e7d1f84997 100644 --- a/rust/docs/schema/Trait_AttributeTypeAPI.adoc +++ b/rust/docs/schema/Trait_AttributeTypeAPI.adoc @@ -13,7 +13,7 @@ ---- fn get<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, value: Value ) -> BoxPromise<'tx, Result>> ---- @@ -26,7 +26,7 @@ Retrieves an ``Attribute`` of this ``AttributeType`` with the given value if suc [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `value` a| ``Attribute``’s value a| `Value` |=== @@ -67,11 +67,11 @@ attribute = attribute_type.get(transaction, value).resolve(); [source,rust] ---- -fn get_instances( +fn get_instances<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- Retrieves all direct and indirect (or direct only) ``Attributes`` that are instances of this ``AttributeType``. @@ -82,7 +82,7 @@ Retrieves all direct and indirect (or direct only) ``Attributes`` that are insta [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect subtypes, ``Transitivity::Explicit`` for direct subtypes only a| `Transitivity` |=== @@ -90,7 +90,7 @@ a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect subtyp .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -105,12 +105,12 @@ attribute_type.get_instances(transaction, transitivity) [source,rust] ---- -fn get_owners( +fn get_owners<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity, annotations: Vec -) -> Result>> +) -> Result>> ---- Retrieve all ``Things`` that own an attribute of this ``AttributeType`` and have all given ``Annotation``s. @@ -121,7 +121,7 @@ Retrieve all ``Things`` that own an attribute of this ``AttributeType`` and have [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `transitivity` a| ``Transitivity::Transitive`` for direct and inherited ownership, ``Transitivity::Explicit`` for direct ownership only a| `Transitivity` a| `annotations` a| Only retrieve ``ThingTypes`` that have an attribute of this ``AttributeType`` with all given ``Annotation``s a| `Vec` |=== @@ -130,7 +130,7 @@ a| `annotations` a| Only retrieve ``ThingTypes`` that have an attribute of this .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -147,7 +147,7 @@ attribute_type.get_owners(transaction, transitivity, annotations) ---- fn get_regex<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result>> ---- @@ -159,7 +159,7 @@ Retrieves the regular expression that is defined for this ``AttributeType``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -199,11 +199,11 @@ attribute_type.get_regex(transaction).resolve(); [source,rust] ---- -fn get_subtypes( +fn get_subtypes<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- Retrieves all direct and indirect (or direct only) subtypes of this ``AttributeType``. @@ -214,7 +214,7 @@ Retrieves all direct and indirect (or direct only) subtypes of this ``AttributeT [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect subtypes, ``Transitivity::Explicit`` for direct subtypes only a| `Transitivity` |=== @@ -222,7 +222,7 @@ a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect subtyp .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -237,12 +237,12 @@ attribute_type.get_subtypes(transaction, transitivity) [source,rust] ---- -fn get_subtypes_with_value_type( +fn get_subtypes_with_value_type<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, value_type: ValueType, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- Retrieves all direct and indirect (or direct only) subtypes of this ``AttributeType`` with given ``ValueType``. @@ -253,7 +253,7 @@ Retrieves all direct and indirect (or direct only) subtypes of this ``AttributeT [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `value_type` a| ``ValueType`` for retrieving subtypes a| `ValueType` a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect subtypes, ``Transitivity::Explicit`` for direct subtypes only a| `Transitivity` |=== @@ -262,7 +262,7 @@ a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect subtyp .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -279,7 +279,7 @@ attribute_type.get_subtypes_with_value_type(transaction, value_type, transitivit ---- fn get_supertype<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result>> ---- @@ -291,7 +291,7 @@ Retrieves the most immediate supertype of this ``AttributeType``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -331,10 +331,10 @@ attribute_type.get_supertype(transaction).resolve(); [source,rust] ---- -fn get_supertypes( +fn get_supertypes<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- Retrieves all supertypes of this ``AttributeType``. @@ -345,14 +345,14 @@ Retrieves all supertypes of this ``AttributeType``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -369,7 +369,7 @@ attribute_type.get_supertypes(transaction) ---- fn put<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, value: Value ) -> BoxPromise<'tx, Result> ---- @@ -382,7 +382,7 @@ Adds and returns an ``Attribute`` of this ``AttributeType`` with the given value [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `value` a| New ``Attribute``’s value a| `Value` |=== @@ -425,7 +425,7 @@ attribute = attribute_type.put(transaction, value).resolve(); ---- fn set_regex<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, regex: String ) -> BoxPromise<'tx, Result> ---- @@ -440,7 +440,7 @@ Can only be applied for ``AttributeType``s with a ``string`` value type. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `regex` a| Regular expression a| `String` |=== @@ -483,7 +483,7 @@ attribute_type.set_regex(transaction, regex).resolve(); ---- fn set_supertype<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, supertype: AttributeType ) -> BoxPromise<'tx, Result> ---- @@ -496,7 +496,7 @@ Sets the supplied ``AttributeType`` as the supertype of the current ``AttributeT [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `supertype` a| The ``AttributeType`` to set as the supertype of this ``AttributeType`` a| `AttributeType` |=== @@ -539,7 +539,7 @@ attribute_type.set_supertype(transaction, supertype).resolve(); ---- fn unset_regex<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -551,7 +551,7 @@ Removes the regular expression that is defined for this ``AttributeType``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] diff --git a/rust/docs/schema/Trait_EntityTypeAPI.adoc b/rust/docs/schema/Trait_EntityTypeAPI.adoc index 619658ee44..3fe5bb0d55 100644 --- a/rust/docs/schema/Trait_EntityTypeAPI.adoc +++ b/rust/docs/schema/Trait_EntityTypeAPI.adoc @@ -13,7 +13,7 @@ ---- fn create<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -25,7 +25,7 @@ Creates and returns a new instance of this ``EntityType``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -65,11 +65,11 @@ entity_type.create(transaction).resolve(); [source,rust] ---- -fn get_instances( +fn get_instances<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- Retrieves all direct and indirect (or direct only) ``Entity`` objects that are instances of this ``EntityType``. @@ -80,7 +80,7 @@ Retrieves all direct and indirect (or direct only) ``Entity`` objects that are i [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect instances, ``Transitivity::Explicit`` for direct instances only a| `Transitivity` |=== @@ -88,7 +88,7 @@ a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect instan .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -103,11 +103,11 @@ entity_type.get_instances(transaction, Transitivity::Explicit); [source,rust] ---- -fn get_subtypes( +fn get_subtypes<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- Retrieves all direct and indirect (or direct only) subtypes of the ``EntityType``. @@ -118,7 +118,7 @@ Retrieves all direct and indirect (or direct only) subtypes of the ``EntityType` [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect subtypes, ``Transitivity::Explicit`` for direct subtypes only a| `Transitivity` |=== @@ -126,7 +126,7 @@ a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect subtyp .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -143,7 +143,7 @@ entity_type.get_subtypes(transaction, Transitivity::Transitive); ---- fn get_supertype<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result>> ---- @@ -155,7 +155,7 @@ Retrieves the most immediate supertype of the ``EntityType``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -195,10 +195,10 @@ entity_type.get_supertype(transaction).resolve(); [source,rust] ---- -fn get_supertypes( +fn get_supertypes<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- Retrieves all supertypes of the ``EntityType``. @@ -209,14 +209,14 @@ Retrieves all supertypes of the ``EntityType``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -233,7 +233,7 @@ entity_type.get_supertypes(transaction); ---- fn set_supertype<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, supertype: EntityType ) -> BoxPromise<'tx, Result> ---- @@ -246,7 +246,7 @@ Sets the supplied ``EntityType`` as the supertype of the current ``EntityType``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `supertype` a| The ``EntityType`` to set as the supertype of this ``EntityType`` a| `EntityType` |=== diff --git a/rust/docs/schema/Trait_RelationTypeAPI.adoc b/rust/docs/schema/Trait_RelationTypeAPI.adoc index 58e429a112..c88059efe8 100644 --- a/rust/docs/schema/Trait_RelationTypeAPI.adoc +++ b/rust/docs/schema/Trait_RelationTypeAPI.adoc @@ -13,7 +13,7 @@ ---- fn create<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -25,7 +25,7 @@ Creates and returns an instance of this ``RelationType``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -65,11 +65,11 @@ relation_type.create(transaction).resolve(); [source,rust] ---- -fn get_instances( +fn get_instances<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- Retrieves all direct and indirect (or direct only) ``Relation``s that are instances of this ``RelationType``. @@ -80,7 +80,7 @@ Retrieves all direct and indirect (or direct only) ``Relation``s that are instan [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect instances, ``Transitivity::Explicit`` for direct relates only a| `Transitivity` |=== @@ -88,7 +88,7 @@ a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect instan .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -103,11 +103,11 @@ relation_type.get_instances(transaction, Transitivity::Explicit); [source,rust] ---- -fn get_relates( +fn get_relates<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- Retrieves roles that this ``RelationType`` relates to directly or via inheritance. @@ -118,7 +118,7 @@ Retrieves roles that this ``RelationType`` relates to directly or via inheritanc [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `transitivity` a| ``Transitivity::Transitive`` for direct and inherited relates, ``Transitivity::Explicit`` for direct relates only a| `Transitivity` |=== @@ -126,7 +126,7 @@ a| `transitivity` a| ``Transitivity::Transitive`` for direct and inherited relat .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -143,7 +143,7 @@ relation_type.get_relates(transaction, Transitivity::Transitive); ---- fn get_relates_for_role_label<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_label: String ) -> BoxPromise<'tx, Result>> ---- @@ -156,7 +156,7 @@ Retrieves role with a given ``role_label`` that this ``RelationType`` relates to [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `role_label` a| Label of the role we wish to retrieve a| `String` |=== @@ -199,7 +199,7 @@ relation_type.get_relates_for_role_label(transaction, role_label).resolve(); ---- fn get_relates_overridden<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, overridden_role_label: String ) -> BoxPromise<'tx, Result>> ---- @@ -212,7 +212,7 @@ Retrieves a ``RoleType`` that is overridden by the role with the ``overridden_ro [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `overridden_role_label` a| Label of the role that overrides an inherited role a| `String` |=== @@ -253,11 +253,11 @@ relation_type.get_relates_overridden(transaction, overridden_role_label).resolve [source,rust] ---- -fn get_subtypes( +fn get_subtypes<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- Retrieves all direct and indirect (or direct only) subtypes of the ``RelationType``. @@ -268,7 +268,7 @@ Retrieves all direct and indirect (or direct only) subtypes of the ``RelationTyp [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect subtypes, ``Transitivity::Explicit`` for direct subtypes only a| `Transitivity` |=== @@ -276,7 +276,7 @@ a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect subtyp .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -293,7 +293,7 @@ relation_type.get_subtypes(transaction, Transitivity::Transitive); ---- fn get_supertype<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result>> ---- @@ -305,7 +305,7 @@ Retrieves the most immediate supertype of the ``RelationType``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -345,10 +345,10 @@ relation_type.get_supertype(transaction).resolve(); [source,rust] ---- -fn get_supertypes( +fn get_supertypes<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- Retrieves all supertypes of the ``RelationType``. @@ -359,14 +359,14 @@ Retrieves all supertypes of the ``RelationType``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -383,7 +383,7 @@ relation_type.get_supertypes(transaction); ---- fn set_relates<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_label: String, overridden_role_label: Option ) -> BoxPromise<'tx, Result> @@ -397,7 +397,7 @@ Sets the new role that this ``RelationType`` relates to. If we are setting an ov [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `role_label` a| The new role for the ``RelationType`` to relate to a| `String` a| `overridden_role_label` a| The label being overridden, if applicable a| `Option` |=== @@ -441,7 +441,7 @@ relation_type.set_relates(transaction, role_label, None).resolve(); ---- fn set_supertype<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, supertype: RelationType ) -> BoxPromise<'tx, Result> ---- @@ -454,7 +454,7 @@ Sets the supplied ``RelationType`` as the supertype of the current ``RelationTyp [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `supertype` a| The ``RelationType`` to set as the supertype of this ``RelationType`` a| `RelationType` |=== @@ -497,7 +497,7 @@ relation_type.set_supertype(transaction, super_relation_type).resolve(); ---- fn unset_relates<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_label: String ) -> BoxPromise<'tx, Result> ---- @@ -510,7 +510,7 @@ Disallows this ``RelationType`` from relating to the given role. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `role_label` a| The role to not relate to the relation type. a| `String` |=== diff --git a/rust/docs/schema/Trait_RoleTypeAPI.adoc b/rust/docs/schema/Trait_RoleTypeAPI.adoc index b37311190f..e2ebf68528 100644 --- a/rust/docs/schema/Trait_RoleTypeAPI.adoc +++ b/rust/docs/schema/Trait_RoleTypeAPI.adoc @@ -13,7 +13,7 @@ ---- fn delete<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -25,7 +25,7 @@ Deletes this type from the database. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -65,11 +65,11 @@ role_type.delete(transaction).resolve(); [source,rust] ---- -fn get_player_instances( +fn get_player_instances<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- Retrieves the ``Thing`` instances that play this role. @@ -80,7 +80,7 @@ Retrieves the ``Thing`` instances that play this role. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect playing, ``Transitivity::Explicit`` for direct playing only a| `Transitivity` |=== @@ -88,7 +88,7 @@ a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect playin .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -103,11 +103,11 @@ role_type.get_player_instances(transaction, transitivity) [source,rust] ---- -fn get_player_types( +fn get_player_types<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- Retrieves the ``ThingType``s whose instances play this role. @@ -118,7 +118,7 @@ Retrieves the ``ThingType``s whose instances play this role. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect playing, ``Transitivity::Explicit`` for direct playing only a| `Transitivity` |=== @@ -126,7 +126,7 @@ a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect playin .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -141,11 +141,11 @@ role_type.get_player_types(transaction, transitivity) [source,rust] ---- -fn get_relation_instances( +fn get_relation_instances<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- Retrieves the ``Relation`` instances that this role is related to. @@ -156,7 +156,7 @@ Retrieves the ``Relation`` instances that this role is related to. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect relation, ``Transitivity::Explicit`` for direct relation only a| `Transitivity` |=== @@ -164,7 +164,7 @@ a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect relati .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -181,7 +181,7 @@ role_type.get_relation_instances(transaction, transitivity) ---- fn get_relation_type<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result>> ---- @@ -193,7 +193,7 @@ Retrieves the ``RelationType`` that this role is directly related to. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -233,10 +233,10 @@ role_type.get_relation_type(transaction).resolve(); [source,rust] ---- -fn get_relation_types( +fn get_relation_types<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- Retrieves ``RelationType``s that this role is related to (directly or indirectly). @@ -247,14 +247,14 @@ Retrieves ``RelationType``s that this role is related to (directly or indirectly [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -269,11 +269,11 @@ role_type.get_relation_types(transaction) [source,rust] ---- -fn get_subtypes( +fn get_subtypes<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- Retrieves all direct and indirect (or direct only) subtypes of the ``RoleType``. @@ -284,7 +284,7 @@ Retrieves all direct and indirect (or direct only) subtypes of the ``RoleType``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect subtypes, ``Transitivity::Explicit`` for direct subtypes only a| `Transitivity` |=== @@ -292,7 +292,7 @@ a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect subtyp .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -309,7 +309,7 @@ role_type.get_subtypes(transaction, transitivity) ---- fn get_supertype<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result>> ---- @@ -321,7 +321,7 @@ Retrieves the most immediate supertype of the ``RoleType``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -361,10 +361,10 @@ role_type.get_supertype(transaction).resolve(); [source,rust] ---- -fn get_supertypes( +fn get_supertypes<'tx>( &self, - transaction: &Transaction<'_> -) -> Result>> + transaction: &'tx Transaction<'_> +) -> Result>> ---- Retrieves all supertypes of the ``RoleType``. @@ -375,14 +375,14 @@ Retrieves all supertypes of the ``RoleType``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -423,7 +423,7 @@ role_type.is_abstract() ---- fn is_deleted<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -435,7 +435,7 @@ Checks if this type is deleted. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -477,7 +477,7 @@ role_type.is_deleted(transaction).resolve(); ---- fn set_label<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, new_label: String ) -> BoxPromise<'tx, Result> ---- @@ -490,7 +490,7 @@ Renames the label of the type. The new label must remain unique. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `new_label` a| The new ``Label`` to be given to the type. a| `String` |=== diff --git a/rust/docs/schema/Trait_ThingTypeAPI.adoc b/rust/docs/schema/Trait_ThingTypeAPI.adoc index 6ba715ccc3..f588b63ad9 100644 --- a/rust/docs/schema/Trait_ThingTypeAPI.adoc +++ b/rust/docs/schema/Trait_ThingTypeAPI.adoc @@ -16,7 +16,7 @@ ---- fn delete<'tx>( &mut self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -28,7 +28,7 @@ Deletes this type from the database. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -68,13 +68,13 @@ thing_type.delete(transaction).resolve(); [source,rust] ---- -fn get_owns( +fn get_owns<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, value_type: Option, transitivity: Transitivity, annotations: Vec -) -> Result>> +) -> Result>> ---- Retrieves ``AttributeType`` that the instances of this ``ThingType`` are allowed to own directly or via inheritance. @@ -85,7 +85,7 @@ Retrieves ``AttributeType`` that the instances of this ``ThingType`` are allowed [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `value_type` a| If specified, only attribute types of this ``ValueType`` will be retrieved. a| `Option` a| `transitivity` a| ``Transitivity::Transitive`` for direct and inherited ownership, ``Transitivity::Explicit`` for direct ownership only a| `Transitivity` a| `annotations` a| Only retrieve attribute types owned with annotations. a| `Vec` @@ -95,7 +95,7 @@ a| `annotations` a| Only retrieve attribute types owned with annotations. a| `Ve .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -130,7 +130,7 @@ thing_type.get_owns(transaction, Some(value_type), Transitivity::Explicit, vec![ ---- fn get_owns_overridden<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, overridden_attribute_type: AttributeType ) -> BoxPromise<'tx, Result>> ---- @@ -143,7 +143,7 @@ Retrieves an ``AttributeType``, ownership of which is overridden for this ``Thin [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `overridden_attribute_type` a| The ``AttributeType`` that overrides requested ``AttributeType`` a| `AttributeType` |=== @@ -184,11 +184,11 @@ thing_type.get_owns_overridden(transaction, attribute_type).resolve(); [source,rust] ---- -fn get_plays( +fn get_plays<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity -) -> Result>> +) -> Result>> ---- Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ``ThingType``. @@ -199,7 +199,7 @@ Retrieves all direct and inherited (or direct only) roles that are allowed to be [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&Transaction<'_>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect playing, ``Transitivity::Explicit`` for direct playing only a| `Transitivity` |=== @@ -207,7 +207,7 @@ a| `transitivity` a| ``Transitivity::Transitive`` for direct and indirect playin .Returns [source,rust] ---- -Result>> +Result>> ---- [caption=""] @@ -242,7 +242,7 @@ thing_type.get_plays(transaction, Transitivity::Explicit).resolve(); ---- fn get_plays_overridden<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, overridden_role_type: RoleType ) -> BoxPromise<'tx, Result>> ---- @@ -255,7 +255,7 @@ Retrieves a ``RoleType`` that is overridden by the given ``role_type`` for this [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `overridden_role_type` a| The ``RoleType`` that overrides an inherited role a| `RoleType` |=== @@ -298,7 +298,7 @@ thing_type.get_plays_overridden(transaction, role_type).resolve(); ---- fn get_syntax<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -310,7 +310,7 @@ Produces a pattern for creating this ``ThingType`` in a ``define`` query. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -376,7 +376,7 @@ thing_type.is_abstract(); ---- fn is_deleted<'tx>( &self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -388,7 +388,7 @@ Checks if this type is deleted. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -478,7 +478,7 @@ thing_type.label(); ---- fn set_abstract<'tx>( &mut self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -490,7 +490,7 @@ Set a type to be abstract, meaning it cannot have instances. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -532,7 +532,7 @@ thing_type.set_abstract(transaction).resolve(); ---- fn set_label<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, new_label: String ) -> BoxPromise<'tx, Result> ---- @@ -545,7 +545,7 @@ Renames the label of the type. The new label must remain unique. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `new_label` a| The new ``Label`` to be given to the type. a| `String` |=== @@ -588,7 +588,7 @@ thing_type.set_label(transaction, new_label).resolve(); ---- fn set_owns<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, attribute_type: AttributeType, overridden_attribute_type: Option, annotations: Vec @@ -603,7 +603,7 @@ Allows the instances of this ``ThingType`` to own the given ``AttributeType``. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `attribute_type` a| The ``AttributeType`` to be owned by the instances of this type. a| `AttributeType` a| `overridden_attribute_type` a| The ``AttributeType`` that this attribute ownership overrides, if applicable. a| `Option` a| `annotations` a| Adds annotations to the ownership. a| `Vec` @@ -648,7 +648,7 @@ thing_type.set_owns(transaction, attribute_type, Some(overridden_type), vec![Ann ---- fn set_plays<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_type: RoleType, overridden_role_type: Option ) -> BoxPromise<'tx, Result> @@ -662,7 +662,7 @@ Allows the instances of this ``ThingType`` to play the given role. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `role_type` a| The role to be played by the instances of this type a| `RoleType` a| `overridden_role_type` a| The role type that this role overrides, if applicable a| `Option` |=== @@ -706,7 +706,7 @@ thing_type.set_plays(transaction, role_type, None).resolve(); ---- fn unset_abstract<'tx>( &mut self, - transaction: &'tx Transaction<'tx> + transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result> ---- @@ -718,7 +718,7 @@ Set a type to be non-abstract, meaning it can have instances. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` |=== [caption=""] @@ -760,7 +760,7 @@ thing_type.unset_abstract(transaction).resolve(); ---- fn unset_owns<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, attribute_type: AttributeType ) -> BoxPromise<'tx, Result> ---- @@ -773,7 +773,7 @@ Disallows the instances of this ``ThingType`` from owning the given ``AttributeT [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `attribute_type` a| The ``AttributeType`` to not be owned by the type. a| `AttributeType` |=== @@ -816,7 +816,7 @@ thing_type.unset_owns(transaction, attribute_type).resolve(); ---- fn unset_plays<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_type: RoleType ) -> BoxPromise<'tx, Result> ---- @@ -829,7 +829,7 @@ Disallows the instances of this ``ThingType`` from playing the given role. [options="header"] |=== |Name |Description |Type -a| `transaction` a| The current transaction a| `&'tx Transaction<'tx>` +a| `transaction` a| The current transaction a| `&'tx Transaction<'_>` a| `role_type` a| The role to not be played by the instances of this type. a| `RoleType` |=== diff --git a/rust/docs/transaction/QueryManager.adoc b/rust/docs/transaction/QueryManager.adoc index 600e12f7b9..0085d8632a 100644 --- a/rust/docs/transaction/QueryManager.adoc +++ b/rust/docs/transaction/QueryManager.adoc @@ -162,7 +162,7 @@ transaction.query().delete_with_options(query, options).resolve() pub fn explain( &self, explainable: &Explainable -) -> Result>> +) -> Result> + 'tx> ---- Performs a TypeQL Explain query in the transaction. See ``QueryManager::explain_with_options @@ -171,7 +171,7 @@ Performs a TypeQL Explain query in the transaction. See ``QueryManager::explain_ .Returns [source,rust] ---- -Result>> +Result> + 'tx> ---- [#_struct_QueryManager_method_explain_with_options] @@ -183,7 +183,7 @@ pub fn explain_with_options( &self, explainable: &Explainable, options: Options -) -> Result>> +) -> Result> + 'tx> ---- Performs a TypeQL Explain query in the transaction. @@ -202,7 +202,7 @@ a| `options` a| Specify query options a| `Options` .Returns [source,rust] ---- -Result>> +Result> + 'tx> ---- [caption=""] @@ -217,7 +217,10 @@ transaction.query().explain_with_options(explainable, options) [source,rust] ---- -pub fn fetch(&self, query: &str) -> Result>> +pub fn fetch( + &self, + query: &str +) -> Result> + 'tx> ---- Performs a TypeQL Fetch query with default options. See <<#_struct_QueryManager_method_fetch_with_options,`QueryManager::fetch_with_options`>> @@ -226,7 +229,7 @@ Performs a TypeQL Fetch query with default options. See <<#_struct_QueryManager_ .Returns [source,rust] ---- -Result>> +Result> + 'tx> ---- [#_struct_QueryManager_method_fetch_with_options] @@ -238,7 +241,7 @@ pub fn fetch_with_options( &self, query: &str, options: Options -) -> Result>> +) -> Result> + 'tx> ---- Performs a TypeQL Match Group Aggregate query in the transaction. @@ -257,7 +260,7 @@ a| `options` a| Specify query options a| `Options` .Returns [source,rust] ---- -Result>> +Result> + 'tx> ---- [caption=""] @@ -272,7 +275,10 @@ transaction.query().fetch_with_options(query, options) [source,rust] ---- -pub fn get(&self, query: &str) -> Result>> +pub fn get( + &self, + query: &str +) -> Result> + 'tx> ---- Performs a TypeQL Match (Get) query with default options. See <<#_struct_QueryManager_method_get_with_options,`QueryManager::get_with_options`>> @@ -281,7 +287,7 @@ Performs a TypeQL Match (Get) query with default options. See <<#_struct_QueryMa .Returns [source,rust] ---- -Result>> +Result> + 'tx> ---- [#_struct_QueryManager_method_get_aggregate] @@ -368,7 +374,7 @@ transaction.query().get_aggregate_with_options(query, options).resolve() pub fn get_group( &self, query: &str -) -> Result>> +) -> Result> + 'tx> ---- Performs a TypeQL Match Group query with default options. See <<#_struct_QueryManager_method_get_group,`QueryManager::get_group`>> @@ -377,7 +383,7 @@ Performs a TypeQL Match Group query with default options. See <<#_struct_QueryMa .Returns [source,rust] ---- -Result>> +Result> + 'tx> ---- [#_struct_QueryManager_method_get_group_aggregate] @@ -388,7 +394,7 @@ Result>> pub fn get_group_aggregate( &self, query: &str -) -> Result>> +) -> Result> + 'tx> ---- Performs a TypeQL Match Group Aggregate query with default options. See <<#_struct_QueryManager_method_get_group_aggregate_with_options,`QueryManager::get_group_aggregate_with_options`>> @@ -397,7 +403,7 @@ Performs a TypeQL Match Group Aggregate query with default options. See <<#_stru .Returns [source,rust] ---- -Result>> +Result> + 'tx> ---- [#_struct_QueryManager_method_get_group_aggregate_with_options] @@ -409,7 +415,7 @@ pub fn get_group_aggregate_with_options( &self, query: &str, options: Options -) -> Result>> +) -> Result> + 'tx> ---- Performs a TypeQL Match Group Aggregate query in the transaction. @@ -428,7 +434,7 @@ a| `options` a| Specify query options a| `Options` .Returns [source,rust] ---- -Result>> +Result> + 'tx> ---- [caption=""] @@ -447,7 +453,7 @@ pub fn get_group_with_options( &self, query: &str, options: Options -) -> Result>> +) -> Result> + 'tx> ---- Performs a TypeQL Match Group query in the transaction. @@ -466,7 +472,7 @@ a| `options` a| Specify query options a| `Options` .Returns [source,rust] ---- -Result>> +Result> + 'tx> ---- [caption=""] @@ -485,7 +491,7 @@ pub fn get_with_options( &self, query: &str, options: Options -) -> Result>> +) -> Result> + 'tx> ---- Performs a TypeQL Match (Get) query in the transaction. @@ -504,7 +510,7 @@ a| `options` a| Specify query options a| `Options` .Returns [source,rust] ---- -Result>> +Result> + 'tx> ---- [caption=""] @@ -522,7 +528,7 @@ transaction.query().get_with_options(query, options) pub fn insert( &self, query: &str -) -> Result>> +) -> Result> + 'tx> ---- Performs a TypeQL Insert query with default options. See <<#_struct_QueryManager_method_insert_with_options,`QueryManager::insert_with_options`>> @@ -531,7 +537,7 @@ Performs a TypeQL Insert query with default options. See <<#_struct_QueryManager .Returns [source,rust] ---- -Result>> +Result> + 'tx> ---- [#_struct_QueryManager_method_insert_with_options] @@ -543,7 +549,7 @@ pub fn insert_with_options( &self, query: &str, options: Options -) -> Result>> +) -> Result> + 'tx> ---- Performs a TypeQL Insert query in the transaction. @@ -562,7 +568,7 @@ a| `options` a| Specify query options a| `Options` .Returns [source,rust] ---- -Result>> +Result> + 'tx> ---- [caption=""] @@ -653,7 +659,7 @@ transaction.query().undefine_with_options(query, options).resolve() pub fn update( &self, query: &str -) -> Result>> +) -> Result> + 'tx> ---- Performs a TypeQL Update query with default options. See <<#_struct_QueryManager_method_update_with_options,`QueryManager::update_with_options`>> @@ -662,7 +668,7 @@ Performs a TypeQL Update query with default options. See <<#_struct_QueryManager .Returns [source,rust] ---- -Result>> +Result> + 'tx> ---- [#_struct_QueryManager_method_update_with_options] @@ -674,7 +680,7 @@ pub fn update_with_options( &self, query: &str, options: Options -) -> Result>> +) -> Result> + 'tx> ---- Performs a TypeQL Update query in the transaction. @@ -693,7 +699,7 @@ a| `options` a| Specify query options a| `Options` .Returns [source,rust] ---- -Result>> +Result> + 'tx> ---- [caption=""] diff --git a/rust/src/connection/network/transmitter/transaction.rs b/rust/src/connection/network/transmitter/transaction.rs index 157c707e88..3f40f36dba 100644 --- a/rust/src/connection/network/transmitter/transaction.rs +++ b/rust/src/connection/network/transmitter/transaction.rs @@ -259,7 +259,9 @@ impl TransactionTransmitter { match grpc_source.next().await { Some(Ok(message)) => collector.collect(message).await, Some(Err(err)) => { - break collector.close(ConnectionError::TransactionIsClosedWithErrors(err.to_string())).await + break collector + .close(ConnectionError::TransactionIsClosedWithErrors(err.message().to_owned())) + .await } None => break collector.close(ConnectionError::TransactionIsClosed()).await, } diff --git a/rust/src/transaction/concept/api/thing.rs b/rust/src/transaction/concept/api/thing.rs index a377588f75..90baeba353 100644 --- a/rust/src/transaction/concept/api/thing.rs +++ b/rust/src/transaction/concept/api/thing.rs @@ -58,7 +58,7 @@ pub trait ThingAPI: Sync + Send { #[cfg_attr(feature = "sync", doc = "thing.is_deleted(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "thing.is_deleted(transaction).await;")] /// ``` - fn is_deleted<'tx>(&'tx self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result>; + fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result>; /// Deletes this `Thing`. /// @@ -72,7 +72,7 @@ pub trait ThingAPI: Sync + Send { #[cfg_attr(feature = "sync", doc = "thing.delete(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "thing.delete(transaction).await;")] /// ``` - fn delete<'tx>(&'tx self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn delete<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.thing_delete(self.to_thing_cloned())) } @@ -90,12 +90,12 @@ pub trait ThingAPI: Sync + Send { /// ```rust /// thing.get_has(transaction, attribute_type, annotations=vec![Annotation::Key]); /// ``` - fn get_has( + fn get_has<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, attribute_types: Vec, annotations: Vec, - ) -> Result>> { + ) -> Result>> { transaction .transaction_stream .thing_get_has(self.to_thing_cloned(), attribute_types, annotations) @@ -115,7 +115,7 @@ pub trait ThingAPI: Sync + Send { #[cfg_attr(feature = "sync", doc = "thing.set_has(transaction, attribute).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "thing.set_has(transaction, attribute).await;")] /// ``` - fn set_has<'tx>(&'tx self, transaction: &'tx Transaction<'tx>, attribute: Attribute) -> BoxPromise<'tx, Result> { + fn set_has<'tx>(&self, transaction: &'tx Transaction<'_>, attribute: Attribute) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.thing_set_has(self.to_thing_cloned(), attribute)) } @@ -132,7 +132,7 @@ pub trait ThingAPI: Sync + Send { #[cfg_attr(feature = "sync", doc = "thing.unset_has(transaction, attribute).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "thing.unset_has(transaction, attribute).await;")] /// ``` - fn unset_has<'tx>(&'tx self, transaction: &'tx Transaction<'tx>, attribute: Attribute) -> BoxPromise<'tx, Result> { + fn unset_has<'tx>(&self, transaction: &'tx Transaction<'_>, attribute: Attribute) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.thing_unset_has(self.to_thing_cloned(), attribute)) } @@ -148,11 +148,11 @@ pub trait ThingAPI: Sync + Send { /// ```rust /// thing.get_relations(transaction, role_types); /// ``` - fn get_relations( + fn get_relations<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, role_types: Vec, - ) -> Result>> { + ) -> Result>> { transaction.transaction_stream.thing_get_relations(self.to_thing_cloned(), role_types).map(box_stream) } @@ -167,7 +167,7 @@ pub trait ThingAPI: Sync + Send { /// ```rust /// thing.get_playing(transaction); /// ``` - fn get_playing(&self, transaction: &Transaction<'_>) -> Result>> { + fn get_playing<'tx>(&self, transaction: &'tx Transaction<'_>) -> Result>> { transaction.transaction_stream.thing_get_playing(self.to_thing_cloned()).map(box_stream) } } @@ -193,7 +193,7 @@ impl ThingAPI for Thing { self.clone() } - fn is_deleted<'tx>(&'tx self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { match self { Thing::Entity(entity) => entity.is_deleted(transaction), Thing::Relation(relation) => relation.is_deleted(transaction), @@ -215,7 +215,7 @@ impl ThingAPI for Entity { Thing::Entity(self.clone()) } - fn is_deleted<'tx>(&'tx self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { let promise = transaction.transaction_stream.get_entity(self.iid().clone()); box_promise(promisify! { resolve!(promise).map(|res| res.is_none()) @@ -240,7 +240,7 @@ impl ThingAPI for Relation { Thing::Relation(self.clone()) } - fn is_deleted<'tx>(&'tx self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { let promise = transaction.transaction_stream.get_relation(self.iid().clone()); box_promise(promisify! { resolve!(promise).map(|res| res.is_none()) @@ -264,8 +264,8 @@ pub trait RelationAPI: ThingAPI + Clone + Into { #[cfg_attr(not(feature = "sync"), doc = "relation.add_role_player(transaction, role_type, player).await;")] /// ``` fn add_role_player<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx>, + &self, + transaction: &'tx Transaction<'_>, role_type: RoleType, player: Thing, ) -> BoxPromise<'tx, Result> { @@ -287,8 +287,8 @@ pub trait RelationAPI: ThingAPI + Clone + Into { #[cfg_attr(not(feature = "sync"), doc = "relation.remove_role_player(transaction, role_type, player).await;")] /// ``` fn remove_role_player<'tx>( - &'tx self, - transaction: &'tx Transaction<'tx>, + &self, + transaction: &'tx Transaction<'_>, role_type: RoleType, player: Thing, ) -> BoxPromise<'tx, Result> { @@ -307,11 +307,11 @@ pub trait RelationAPI: ThingAPI + Clone + Into { /// ```rust /// relation.get_players_by_role_type(transaction, role_types); /// ``` - fn get_players_by_role_type( + fn get_players_by_role_type<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, role_types: Vec, - ) -> Result>> { + ) -> Result>> { transaction .transaction_stream .relation_get_players_by_role_type(self.clone().into(), role_types) @@ -329,7 +329,10 @@ pub trait RelationAPI: ThingAPI + Clone + Into { /// ```rust /// relation.get_role_players(transaction) /// ``` - fn get_role_players(&self, transaction: &Transaction<'_>) -> Result>> { + fn get_role_players<'tx>( + &self, + transaction: &'tx Transaction<'_>, + ) -> Result>> { transaction.transaction_stream.relation_get_role_players(self.clone().into()).map(box_stream) } @@ -344,7 +347,7 @@ pub trait RelationAPI: ThingAPI + Clone + Into { /// ```rust /// relation.get_relating(transaction) /// ``` - fn get_relating(&self, transaction: &Transaction<'_>) -> Result>> { + fn get_relating<'tx>(&self, transaction: &'tx Transaction<'_>) -> Result>> { transaction.transaction_stream.relation_get_relating(self.clone().into()).map(box_stream) } } @@ -364,7 +367,7 @@ impl ThingAPI for Attribute { Thing::Attribute(self.clone()) } - fn is_deleted<'tx>(&'tx self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { let promise = transaction.transaction_stream.get_attribute(self.iid().clone()); box_promise(promisify! { resolve!(promise).map(|res| res.is_none()) @@ -385,11 +388,11 @@ pub trait AttributeAPI: ThingAPI + Clone + Into { /// ```rust /// attribute.get_owners(transaction, Some(owner_type)); /// ``` - fn get_owners( + fn get_owners<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, thing_type: Option, - ) -> Result>> { + ) -> Result>> { transaction.transaction_stream.attribute_get_owners(self.clone().into(), thing_type).map(box_stream) } } diff --git a/rust/src/transaction/concept/api/type_.rs b/rust/src/transaction/concept/api/type_.rs index 2e3ace2893..e77d0fafe9 100644 --- a/rust/src/transaction/concept/api/type_.rs +++ b/rust/src/transaction/concept/api/type_.rs @@ -70,7 +70,7 @@ pub trait ThingTypeAPI: Sync + Send { #[cfg_attr(feature = "sync", doc = "thing_type.is_deleted(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "thing_type.is_deleted(transaction).await;")] /// ``` - fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result>; + fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result>; /// Deletes this type from the database. /// @@ -84,7 +84,7 @@ pub trait ThingTypeAPI: Sync + Send { #[cfg_attr(feature = "sync", doc = "thing_type.delete(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "thing_type.delete(transaction).await;")] /// ``` - fn delete<'tx>(&mut self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn delete<'tx>(&mut self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.thing_type_delete(self.to_thing_type_cloned())) } @@ -101,7 +101,7 @@ pub trait ThingTypeAPI: Sync + Send { #[cfg_attr(feature = "sync", doc = "thing_type.set_label(transaction, new_label).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "thing_type.set_label(transaction, new_label).await;")] /// ``` - fn set_label<'tx>(&mut self, transaction: &'tx Transaction<'tx>, new_label: String) -> BoxPromise<'tx, Result> { + fn set_label<'tx>(&mut self, transaction: &'tx Transaction<'_>, new_label: String) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.thing_type_set_label(self.to_thing_type_cloned(), new_label)) } @@ -117,7 +117,7 @@ pub trait ThingTypeAPI: Sync + Send { #[cfg_attr(feature = "sync", doc = "thing_type.set_abstract(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "thing_type.set_abstract(transaction).await;")] /// ``` - fn set_abstract<'tx>(&mut self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn set_abstract<'tx>(&mut self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.thing_type_set_abstract(self.to_thing_type_cloned())) } @@ -133,7 +133,7 @@ pub trait ThingTypeAPI: Sync + Send { #[cfg_attr(feature = "sync", doc = "thing_type.unset_abstract(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "thing_type.unset_abstract(transaction).await;")] /// ``` - fn unset_abstract<'tx>(&mut self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn unset_abstract<'tx>(&mut self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.thing_type_unset_abstract(self.to_thing_type_cloned())) } @@ -160,13 +160,13 @@ pub trait ThingTypeAPI: Sync + Send { doc = "thing_type.get_owns(transaction, Some(value_type), Transitivity::Explicit, vec![Annotation::Key]).await;" )] /// ``` - fn get_owns( + fn get_owns<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, value_type: Option, transitivity: Transitivity, annotations: Vec, - ) -> Result>> { + ) -> Result>> { transaction .transaction_stream .thing_type_get_owns(self.to_thing_type_cloned(), value_type, transitivity, annotations) @@ -189,7 +189,7 @@ pub trait ThingTypeAPI: Sync + Send { /// ``` fn get_owns_overridden<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, overridden_attribute_type: AttributeType, ) -> BoxPromise<'tx, Result>> { box_promise( @@ -223,7 +223,7 @@ pub trait ThingTypeAPI: Sync + Send { /// ``` fn set_owns<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, attribute_type: AttributeType, overridden_attribute_type: Option, annotations: Vec, @@ -251,7 +251,7 @@ pub trait ThingTypeAPI: Sync + Send { /// ``` fn unset_owns<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, attribute_type: AttributeType, ) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.thing_type_unset_owns(self.to_thing_type_cloned(), attribute_type)) @@ -272,11 +272,11 @@ pub trait ThingTypeAPI: Sync + Send { #[cfg_attr(feature = "sync", doc = "thing_type.get_plays(transaction, Transitivity::Explicit).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "thing_type.get_plays(transaction, Transitivity::Explicit).await;")] /// ``` - fn get_plays( + fn get_plays<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity, - ) -> Result>> { + ) -> Result>> { transaction.transaction_stream.thing_type_get_plays(self.to_thing_type_cloned(), transitivity).map(box_stream) } @@ -295,7 +295,7 @@ pub trait ThingTypeAPI: Sync + Send { /// ``` fn get_plays_overridden<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, overridden_role_type: RoleType, ) -> BoxPromise<'tx, Result>> { box_promise( @@ -321,7 +321,7 @@ pub trait ThingTypeAPI: Sync + Send { /// ``` fn set_plays<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_type: RoleType, overridden_role_type: Option, ) -> BoxPromise<'tx, Result> { @@ -345,7 +345,7 @@ pub trait ThingTypeAPI: Sync + Send { #[cfg_attr(feature = "sync", doc = "thing_type.unset_plays(transaction, role_type).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "thing_type.unset_plays(transaction, role_type).await;")] /// ``` - fn unset_plays<'tx>(&mut self, transaction: &'tx Transaction<'tx>, role_type: RoleType) -> BoxPromise<'tx, Result> { + fn unset_plays<'tx>(&mut self, transaction: &'tx Transaction<'_>, role_type: RoleType) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.thing_type_unset_plays(self.to_thing_type_cloned(), role_type)) } @@ -361,7 +361,7 @@ pub trait ThingTypeAPI: Sync + Send { #[cfg_attr(feature = "sync", doc = "thing_type.get_syntax(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "thing_type.get_syntax(transaction).await;")] /// ``` - fn get_syntax<'tx>(&self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn get_syntax<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.thing_type_get_syntax(self.to_thing_type_cloned())) } } @@ -383,7 +383,7 @@ impl ThingTypeAPI for RootThingType { ThingType::RootThingType(self.clone()) } - fn is_deleted<'tx>(&self, _transaction: &Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn is_deleted<'tx>(&self, _transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { box_promise(promisify! { Ok(false) }) } } @@ -405,7 +405,7 @@ impl ThingTypeAPI for EntityType { ThingType::EntityType(self.clone()) } - fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { let promise = transaction.transaction_stream.get_entity_type(self.label().to_owned()); box_promise(promisify! { resolve!(promise).map(|res| res.is_none()) }) } @@ -424,7 +424,7 @@ pub trait EntityTypeAPI: ThingTypeAPI + Clone + Into { #[cfg_attr(feature = "sync", doc = "entity_type.create(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "entity_type.create(transaction).await;")] /// ``` - fn create<'tx>(&self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn create<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.entity_type_create(self.clone().into())) } @@ -440,7 +440,7 @@ pub trait EntityTypeAPI: ThingTypeAPI + Clone + Into { #[cfg_attr(feature = "sync", doc = "entity_type.get_supertype(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "entity_type.get_supertype(transaction).await;")] /// ``` - fn get_supertype<'tx>(&self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result>> { + fn get_supertype<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result>> { box_promise(transaction.transaction_stream.entity_type_get_supertype(self.clone().into())) } @@ -459,7 +459,7 @@ pub trait EntityTypeAPI: ThingTypeAPI + Clone + Into { /// ``` fn set_supertype<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, supertype: EntityType, ) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.entity_type_set_supertype(self.clone().into(), supertype)) @@ -476,7 +476,7 @@ pub trait EntityTypeAPI: ThingTypeAPI + Clone + Into { /// ```rust /// entity_type.get_supertypes(transaction); /// ``` - fn get_supertypes(&self, transaction: &Transaction<'_>) -> Result>> { + fn get_supertypes<'tx>(&self, transaction: &'tx Transaction<'_>) -> Result>> { transaction.transaction_stream.entity_type_get_supertypes(self.clone().into()).map(box_stream) } @@ -493,11 +493,11 @@ pub trait EntityTypeAPI: ThingTypeAPI + Clone + Into { /// ```rust /// entity_type.get_subtypes(transaction, Transitivity::Transitive); /// ``` - fn get_subtypes( + fn get_subtypes<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity, - ) -> Result>> { + ) -> Result>> { transaction.transaction_stream.entity_type_get_subtypes(self.clone().into(), transitivity).map(box_stream) } @@ -515,11 +515,11 @@ pub trait EntityTypeAPI: ThingTypeAPI + Clone + Into { /// ```rust /// entity_type.get_instances(transaction, Transitivity::Explicit); /// ``` - fn get_instances( + fn get_instances<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity, - ) -> Result>> { + ) -> Result>> { transaction.transaction_stream.entity_type_get_instances(self.clone().into(), transitivity).map(box_stream) } } @@ -543,7 +543,7 @@ impl ThingTypeAPI for RelationType { ThingType::RelationType(self.clone()) } - fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { let promise = transaction.transaction_stream.get_relation_type(self.label().to_owned()); box_promise(promisify! { resolve!(promise).map(|res| res.is_none()) }) } @@ -562,7 +562,7 @@ pub trait RelationTypeAPI: ThingTypeAPI + Clone + Into { #[cfg_attr(feature = "sync", doc = "relation_type.create(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "relation_type.create(transaction).await;")] /// ``` - fn create<'tx>(&self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn create<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.relation_type_create(self.clone().into())) } @@ -578,7 +578,7 @@ pub trait RelationTypeAPI: ThingTypeAPI + Clone + Into { #[cfg_attr(feature = "sync", doc = "relation_type.get_supertype(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "relation_type.get_supertype(transaction).await;")] /// ``` - fn get_supertype<'tx>(&self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result>> { + fn get_supertype<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result>> { box_promise(transaction.transaction_stream.relation_type_get_supertype(self.clone().into())) } @@ -597,7 +597,7 @@ pub trait RelationTypeAPI: ThingTypeAPI + Clone + Into { /// ``` fn set_supertype<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, supertype: RelationType, ) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.relation_type_set_supertype(self.clone().into(), supertype)) @@ -614,7 +614,7 @@ pub trait RelationTypeAPI: ThingTypeAPI + Clone + Into { /// ```rust /// relation_type.get_supertypes(transaction); /// ``` - fn get_supertypes(&self, transaction: &Transaction<'_>) -> Result>> { + fn get_supertypes<'tx>(&self, transaction: &'tx Transaction<'_>) -> Result>> { transaction.transaction_stream.relation_type_get_supertypes(self.clone().into()).map(box_stream) } @@ -631,11 +631,11 @@ pub trait RelationTypeAPI: ThingTypeAPI + Clone + Into { /// ```rust /// relation_type.get_subtypes(transaction, Transitivity::Transitive); /// ``` - fn get_subtypes( + fn get_subtypes<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity, - ) -> Result>> { + ) -> Result>> { transaction.transaction_stream.relation_type_get_subtypes(self.clone().into(), transitivity).map(box_stream) } @@ -653,11 +653,11 @@ pub trait RelationTypeAPI: ThingTypeAPI + Clone + Into { /// ```rust /// relation_type.get_instances(transaction, Transitivity::Explicit); /// ``` - fn get_instances( + fn get_instances<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity, - ) -> Result>> { + ) -> Result>> { transaction.transaction_stream.relation_type_get_instances(self.clone().into(), transitivity).map(box_stream) } @@ -674,11 +674,11 @@ pub trait RelationTypeAPI: ThingTypeAPI + Clone + Into { /// ```rust /// relation_type.get_relates(transaction, Transitivity::Transitive); /// ``` - fn get_relates( + fn get_relates<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity, - ) -> Result>> { + ) -> Result>> { transaction.transaction_stream.relation_type_get_relates(self.clone().into(), transitivity).map(box_stream) } @@ -697,7 +697,7 @@ pub trait RelationTypeAPI: ThingTypeAPI + Clone + Into { /// ``` fn get_relates_for_role_label<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_label: String, ) -> BoxPromise<'tx, Result>> { box_promise( @@ -726,7 +726,7 @@ pub trait RelationTypeAPI: ThingTypeAPI + Clone + Into { /// ``` fn get_relates_overridden<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, overridden_role_label: String, ) -> BoxPromise<'tx, Result>> { box_promise( @@ -753,7 +753,7 @@ pub trait RelationTypeAPI: ThingTypeAPI + Clone + Into { /// ``` fn set_relates<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, role_label: String, overridden_role_label: Option, ) -> BoxPromise<'tx, Result> { @@ -777,11 +777,7 @@ pub trait RelationTypeAPI: ThingTypeAPI + Clone + Into { #[cfg_attr(feature = "sync", doc = "relation_type.unset_relates(transaction, role_label).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "relation_type.unset_relates(transaction, role_label).await;")] /// ``` - fn unset_relates<'tx>( - &mut self, - transaction: &'tx Transaction<'tx>, - role_label: String, - ) -> BoxPromise<'tx, Result> { + fn unset_relates<'tx>(&mut self, transaction: &'tx Transaction<'_>, role_label: String) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.relation_type_unset_relates(self.clone().into(), role_label)) } } @@ -805,7 +801,7 @@ impl ThingTypeAPI for AttributeType { ThingType::AttributeType(self.clone()) } - fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { let promise = transaction.transaction_stream.get_attribute_type(self.label().to_owned()); box_promise(promisify! { resolve!(promise).map(|res| res.is_none()) }) } @@ -834,7 +830,7 @@ pub trait AttributeTypeAPI: ThingTypeAPI + Clone + Into { #[cfg_attr(feature = "sync", doc = "attribute = attribute_type.put(transaction, value).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "attribute = attribute_type.put(transaction, value).await;")] /// ``` - fn put<'tx>(&self, transaction: &'tx Transaction<'tx>, value: Value) -> BoxPromise<'tx, Result> { + fn put<'tx>(&self, transaction: &'tx Transaction<'_>, value: Value) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.attribute_type_put(self.clone().into(), value)) } @@ -852,7 +848,7 @@ pub trait AttributeTypeAPI: ThingTypeAPI + Clone + Into { #[cfg_attr(feature = "sync", doc = "attribute = attribute_type.get(transaction, value).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "attribute = attribute_type.get(transaction, value).await;")] /// ``` - fn get<'tx>(&self, transaction: &'tx Transaction<'tx>, value: Value) -> BoxPromise<'tx, Result>> { + fn get<'tx>(&self, transaction: &'tx Transaction<'_>, value: Value) -> BoxPromise<'tx, Result>> { box_promise(transaction.transaction_stream.attribute_type_get(self.clone().into(), value)) } @@ -868,7 +864,7 @@ pub trait AttributeTypeAPI: ThingTypeAPI + Clone + Into { #[cfg_attr(feature = "sync", doc = "attribute_type.get_supertype(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "attribute_type.get_supertype(transaction).await;")] /// ``` - fn get_supertype<'tx>(&self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result>> { + fn get_supertype<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result>> { box_promise(transaction.transaction_stream.attribute_type_get_supertype(self.clone().into())) } @@ -887,7 +883,7 @@ pub trait AttributeTypeAPI: ThingTypeAPI + Clone + Into { /// ``` fn set_supertype<'tx>( &mut self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, supertype: AttributeType, ) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.attribute_type_set_supertype(self.clone().into(), supertype)) @@ -904,7 +900,7 @@ pub trait AttributeTypeAPI: ThingTypeAPI + Clone + Into { /// ```rust /// attribute_type.get_supertypes(transaction) /// ``` - fn get_supertypes(&self, transaction: &Transaction<'_>) -> Result>> { + fn get_supertypes<'tx>(&self, transaction: &'tx Transaction<'_>) -> Result>> { transaction.transaction_stream.attribute_type_get_supertypes(self.clone().into()).map(box_stream) } @@ -921,11 +917,11 @@ pub trait AttributeTypeAPI: ThingTypeAPI + Clone + Into { /// ```rust /// attribute_type.get_subtypes(transaction, transitivity) /// ``` - fn get_subtypes( + fn get_subtypes<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity, - ) -> Result>> { + ) -> Result>> { // FIXME when None? transaction .transaction_stream @@ -948,12 +944,12 @@ pub trait AttributeTypeAPI: ThingTypeAPI + Clone + Into { /// ```rust /// attribute_type.get_subtypes_with_value_type(transaction, value_type, transitivity) /// ``` - fn get_subtypes_with_value_type( + fn get_subtypes_with_value_type<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, value_type: ValueType, transitivity: Transitivity, - ) -> Result>> { + ) -> Result>> { transaction .transaction_stream .attribute_type_get_subtypes(self.clone().into(), transitivity, Some(value_type)) @@ -974,11 +970,11 @@ pub trait AttributeTypeAPI: ThingTypeAPI + Clone + Into { /// ```rust /// attribute_type.get_instances(transaction, transitivity) /// ``` - fn get_instances( + fn get_instances<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity, - ) -> Result>> { + ) -> Result>> { transaction .transaction_stream .attribute_type_get_instances(self.clone().into(), transitivity, Some(self.value_type())) @@ -997,7 +993,7 @@ pub trait AttributeTypeAPI: ThingTypeAPI + Clone + Into { #[cfg_attr(feature = "sync", doc = "attribute_type.get_regex(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "attribute_type.get_regex(transaction).await;")] /// ``` - fn get_regex<'tx>(&self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result>> { + fn get_regex<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result>> { box_promise(transaction.transaction_stream.attribute_type_get_regex(self.clone().into())) } @@ -1017,7 +1013,7 @@ pub trait AttributeTypeAPI: ThingTypeAPI + Clone + Into { #[cfg_attr(feature = "sync", doc = "attribute_type.set_regex(transaction, regex).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "attribute_type.set_regex(transaction, regex).await;")] /// ``` - fn set_regex<'tx>(&self, transaction: &'tx Transaction<'tx>, regex: String) -> BoxPromise<'tx, Result> { + fn set_regex<'tx>(&self, transaction: &'tx Transaction<'_>, regex: String) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.attribute_type_set_regex(self.clone().into(), regex)) } @@ -1033,7 +1029,7 @@ pub trait AttributeTypeAPI: ThingTypeAPI + Clone + Into { #[cfg_attr(feature = "sync", doc = "attribute_type.unset_regex(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "attribute_type.unset_regex(transaction).await;")] /// ``` - fn unset_regex<'tx>(&self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn unset_regex<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { self.set_regex(transaction, String::new()) } @@ -1053,12 +1049,12 @@ pub trait AttributeTypeAPI: ThingTypeAPI + Clone + Into { /// ```rust /// attribute_type.get_owners(transaction, transitivity, annotations) /// ``` - fn get_owners( + fn get_owners<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity, annotations: Vec, - ) -> Result>> { + ) -> Result>> { transaction .transaction_stream .attribute_type_get_owners(self.clone().into(), transitivity, annotations) @@ -1094,7 +1090,7 @@ pub trait RoleTypeAPI: Clone + Into + Sync + Send { #[cfg_attr(feature = "sync", doc = "role_type.delete(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "role_type.delete(transaction).await;")] /// ``` - fn delete<'tx>(&self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn delete<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.role_type_delete(self.clone().into())) } @@ -1110,7 +1106,7 @@ pub trait RoleTypeAPI: Clone + Into + Sync + Send { #[cfg_attr(feature = "sync", doc = "role_type.is_deleted(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "role_type.is_deleted(transaction).await;")] /// ``` - fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result>; + fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result>; /// Retrieves the `RelationType` that this role is directly related to. /// @@ -1126,7 +1122,7 @@ pub trait RoleTypeAPI: Clone + Into + Sync + Send { /// ``` fn get_relation_type<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, ) -> BoxPromise<'tx, Result>>; /// Renames the label of the type. The new label must remain unique. @@ -1142,7 +1138,7 @@ pub trait RoleTypeAPI: Clone + Into + Sync + Send { #[cfg_attr(feature = "sync", doc = "role_type.set_label(transaction, new_label).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "role_type.set_label(transaction, new_label).await;")] /// ``` - fn set_label<'tx>(&self, transaction: &'tx Transaction<'tx>, new_label: String) -> BoxPromise<'tx, Result> { + fn set_label<'tx>(&self, transaction: &'tx Transaction<'_>, new_label: String) -> BoxPromise<'tx, Result> { box_promise(transaction.transaction_stream.role_type_set_label(self.clone().into(), new_label)) } @@ -1158,7 +1154,7 @@ pub trait RoleTypeAPI: Clone + Into + Sync + Send { #[cfg_attr(feature = "sync", doc = "role_type.get_supertype(transaction).resolve();")] #[cfg_attr(not(feature = "sync"), doc = "role_type.get_supertype(transaction).await;")] /// ``` - fn get_supertype<'tx>(&self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result>> { + fn get_supertype<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result>> { box_promise(transaction.transaction_stream.role_type_get_supertype(self.clone().into())) } @@ -1173,7 +1169,7 @@ pub trait RoleTypeAPI: Clone + Into + Sync + Send { /// ```rust /// role_type.get_supertypes(transaction) /// ``` - fn get_supertypes(&self, transaction: &Transaction<'_>) -> Result>> { + fn get_supertypes<'tx>(&self, transaction: &'tx Transaction<'_>) -> Result>> { transaction.transaction_stream.role_type_get_supertypes(self.clone().into()).map(box_stream) } @@ -1190,11 +1186,11 @@ pub trait RoleTypeAPI: Clone + Into + Sync + Send { /// ```rust /// role_type.get_subtypes(transaction, transitivity) /// ``` - fn get_subtypes( + fn get_subtypes<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity, - ) -> Result>> { + ) -> Result>> { transaction.transaction_stream.role_type_get_subtypes(self.clone().into(), transitivity).map(box_stream) } @@ -1209,7 +1205,10 @@ pub trait RoleTypeAPI: Clone + Into + Sync + Send { /// ```rust /// role_type.get_relation_types(transaction) /// ``` - fn get_relation_types(&self, transaction: &Transaction<'_>) -> Result>> { + fn get_relation_types<'tx>( + &self, + transaction: &'tx Transaction<'_>, + ) -> Result>> { transaction.transaction_stream.role_type_get_relation_types(self.clone().into()).map(box_stream) } @@ -1226,11 +1225,11 @@ pub trait RoleTypeAPI: Clone + Into + Sync + Send { /// ```rust /// role_type.get_player_types(transaction, transitivity) /// ``` - fn get_player_types( + fn get_player_types<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity, - ) -> Result>> { + ) -> Result>> { transaction.transaction_stream.role_type_get_player_types(self.clone().into(), transitivity).map(box_stream) } @@ -1247,11 +1246,11 @@ pub trait RoleTypeAPI: Clone + Into + Sync + Send { /// ```rust /// role_type.get_relation_instances(transaction, transitivity) /// ``` - fn get_relation_instances( + fn get_relation_instances<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity, - ) -> Result>> { + ) -> Result>> { transaction .transaction_stream .role_type_get_relation_instances(self.clone().into(), transitivity) @@ -1271,11 +1270,11 @@ pub trait RoleTypeAPI: Clone + Into + Sync + Send { /// ```rust /// role_type.get_player_instances(transaction, transitivity) /// ``` - fn get_player_instances( + fn get_player_instances<'tx>( &self, - transaction: &Transaction<'_>, + transaction: &'tx Transaction<'_>, transitivity: Transitivity, - ) -> Result>> { + ) -> Result>> { transaction.transaction_stream.role_type_get_player_instances(self.clone().into(), transitivity).map(box_stream) } } @@ -1287,12 +1286,12 @@ impl RoleTypeAPI for RoleType { fn get_relation_type<'tx>( &self, - transaction: &'tx Transaction<'tx>, + transaction: &'tx Transaction<'_>, ) -> BoxPromise<'tx, Result>> { box_promise(transaction.transaction_stream.get_relation_type(self.label.scope.clone())) } - fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'tx>) -> BoxPromise<'tx, Result> { + fn is_deleted<'tx>(&self, transaction: &'tx Transaction<'_>) -> BoxPromise<'tx, Result> { // FIXME only request get_relates_for_role_label() after NPE is fixed in core let relation_type_promise = self.get_relation_type(transaction); let role_name = self.label.name.clone(); diff --git a/rust/src/transaction/concept/manager.rs b/rust/src/transaction/concept/manager.rs index 70d6ffbb63..d602c01ec8 100644 --- a/rust/src/transaction/concept/manager.rs +++ b/rust/src/transaction/concept/manager.rs @@ -192,7 +192,7 @@ impl<'tx> ConceptManager<'tx> { /// ```rust /// transaction.concepts().get_schema_exceptions() /// ``` - pub fn get_schema_exceptions(&self) -> Result>> { + pub fn get_schema_exceptions(&self) -> Result> + 'tx> { self.transaction_stream.get_ref().get_schema_exceptions() } } diff --git a/rust/src/transaction/logic/manager.rs b/rust/src/transaction/logic/manager.rs index 919bb48e63..58e0f52487 100644 --- a/rust/src/transaction/logic/manager.rs +++ b/rust/src/transaction/logic/manager.rs @@ -81,7 +81,7 @@ impl<'tx> LogicManager<'tx> { /// ```rust /// transaction.logic.get_rules() /// ``` - pub fn get_rules(&self) -> Result>> { + pub fn get_rules(&self) -> Result> + 'tx> { self.transaction_stream.get_ref().get_rules() } } diff --git a/rust/src/transaction/query.rs b/rust/src/transaction/query.rs index 524acb40e4..783511e717 100644 --- a/rust/src/transaction/query.rs +++ b/rust/src/transaction/query.rs @@ -117,7 +117,7 @@ impl<'tx> QueryManager<'tx> { /// Performs a TypeQL Match (Get) query with default options. /// See [`QueryManager::get_with_options`] - pub fn get(&self, query: &str) -> Result>> { + pub fn get(&self, query: &str) -> Result> + 'tx> { self.get_with_options(query, Options::new()) } @@ -133,13 +133,17 @@ impl<'tx> QueryManager<'tx> { /// ```rust /// transaction.query().get_with_options(query, options) /// ``` - pub fn get_with_options(&self, query: &str, options: Options) -> Result>> { + pub fn get_with_options( + &self, + query: &str, + options: Options, + ) -> Result> + 'tx> { self.transaction_stream.get_ref().get(query.to_string(), options) } /// Performs a TypeQL Insert query with default options. /// See [`QueryManager::insert_with_options`] - pub fn insert(&self, query: &str) -> Result>> { + pub fn insert(&self, query: &str) -> Result> + 'tx> { self.insert_with_options(query, Options::new()) } @@ -155,13 +159,17 @@ impl<'tx> QueryManager<'tx> { /// ```rust /// transaction.query().insert_with_options(query, options) /// ``` - pub fn insert_with_options(&self, query: &str, options: Options) -> Result>> { + pub fn insert_with_options( + &self, + query: &str, + options: Options, + ) -> Result> + 'tx> { self.transaction_stream.get_ref().insert(query.to_string(), options) } /// Performs a TypeQL Update query with default options. /// See [`QueryManager::update_with_options`] - pub fn update(&self, query: &str) -> Result>> { + pub fn update(&self, query: &str) -> Result> + 'tx> { self.update_with_options(query, Options::new()) } @@ -177,7 +185,11 @@ impl<'tx> QueryManager<'tx> { /// ```rust /// transaction.query().update_with_options(query, options) /// ``` - pub fn update_with_options(&self, query: &str, options: Options) -> Result>> { + pub fn update_with_options( + &self, + query: &str, + options: Options, + ) -> Result> + 'tx> { self.transaction_stream.get_ref().update(query.to_string(), options) } @@ -210,7 +222,7 @@ impl<'tx> QueryManager<'tx> { /// Performs a TypeQL Match Group query with default options. /// See [`QueryManager::get_group`] - pub fn get_group(&self, query: &str) -> Result>> { + pub fn get_group(&self, query: &str) -> Result> + 'tx> { self.get_group_with_options(query, Options::new()) } @@ -230,13 +242,13 @@ impl<'tx> QueryManager<'tx> { &self, query: &str, options: Options, - ) -> Result>> { + ) -> Result> + 'tx> { self.transaction_stream.get_ref().get_group(query.to_string(), options) } /// Performs a TypeQL Match Group Aggregate query with default options. /// See [`QueryManager::get_group_aggregate_with_options`] - pub fn get_group_aggregate(&self, query: &str) -> Result>> { + pub fn get_group_aggregate(&self, query: &str) -> Result> + 'tx> { self.get_group_aggregate_with_options(query, Options::new()) } @@ -256,13 +268,13 @@ impl<'tx> QueryManager<'tx> { &self, query: &str, options: Options, - ) -> Result>> { + ) -> Result> + 'tx> { self.transaction_stream.get_ref().get_group_aggregate(query.to_string(), options) } /// Performs a TypeQL Fetch query with default options. /// See [`QueryManager::fetch_with_options`] - pub fn fetch(&self, query: &str) -> Result>> { + pub fn fetch(&self, query: &str) -> Result> + 'tx> { self.fetch_with_options(query, Options::new()) } @@ -278,13 +290,13 @@ impl<'tx> QueryManager<'tx> { /// ```rust /// transaction.query().fetch_with_options(query, options) /// ``` - pub fn fetch_with_options(&self, query: &str, options: Options) -> Result>> { + pub fn fetch_with_options(&self, query: &str, options: Options) -> Result> + 'tx> { Ok(self.transaction_stream.get_ref().fetch(query.to_string(), options)?.map_ok(|tree| tree.into_json())) } /// Performs a TypeQL Explain query in the transaction. /// See [``QueryManager::explain_with_options] - pub fn explain(&self, explainable: &Explainable) -> Result>> { + pub fn explain(&self, explainable: &Explainable) -> Result> + 'tx> { self.explain_with_options(explainable, Options::new()) } @@ -304,7 +316,7 @@ impl<'tx> QueryManager<'tx> { &self, explainable: &Explainable, options: Options, - ) -> Result>> { + ) -> Result> + 'tx> { self.transaction_stream.get_ref().explain(explainable.id, options) } } diff --git a/rust/tests/behaviour/query/language/steps.rs b/rust/tests/behaviour/query/language/steps.rs index 173b1efc3d..a7b01305db 100644 --- a/rust/tests/behaviour/query/language/steps.rs +++ b/rust/tests/behaviour/query/language/steps.rs @@ -105,14 +105,16 @@ generic_step_impl! { #[step(expr = "get answers of typeql get")] pub async fn get_answers_typeql_get(context: &mut Context, step: &Step) -> TypeDBResult { let parsed = parse_query(step.docstring().unwrap())?; - context.answer = context.transaction().query().get(&parsed.to_string())?.try_collect::>().await?; + let answer = context.transaction().query().get(&parsed.to_string())?.try_collect::>().await?; + context.answer = answer; Ok(()) } #[step(expr = "get answers of typeql insert")] async fn get_answers_typeql_insert(context: &mut Context, step: &Step) -> TypeDBResult { let parsed = parse_query(step.docstring().unwrap())?; - context.answer = context.transaction().query().insert(&parsed.to_string())?.try_collect::>().await?; + let answer = context.transaction().query().insert(&parsed.to_string())?.try_collect::>().await?; + context.answer = answer; Ok(()) } @@ -266,8 +268,8 @@ generic_step_impl! { #[step(expr = "get answers of typeql get group")] async fn get_answers_typeql_get_group(context: &mut Context, step: &Step) -> TypeDBResult { let parsed = parse_query(step.docstring().unwrap())?; - context.answer_group = - context.transaction().query().get_group(&parsed.to_string())?.try_collect::>().await?; + let answer_group = context.transaction().query().get_group(&parsed.to_string())?.try_collect::>().await?; + context.answer_group = answer_group; Ok(()) } @@ -329,8 +331,9 @@ generic_step_impl! { #[step(expr = "get answers of typeql get group aggregate")] async fn get_answers_typeql_get_group_aggregate(context: &mut Context, step: &Step) -> TypeDBResult { let parsed = parse_query(step.docstring().unwrap())?; - context.value_answer_group = + let value_answer_group = context.transaction().query().get_group_aggregate(&parsed.to_string())?.try_collect::>().await?; + context.value_answer_group = value_answer_group; Ok(()) } @@ -379,7 +382,8 @@ generic_step_impl! { #[step(expr = "get answers of typeql fetch")] pub async fn get_answers_typeql_fetch(context: &mut Context, step: &Step) -> TypeDBResult { let parsed = parse_query(step.docstring().unwrap())?; - context.fetch_answer = Some(JSON::Array(context.transaction().query().fetch(&parsed.to_string())?.try_collect().await?)); + let fetch_answer = Some(JSON::Array(context.transaction().query().fetch(&parsed.to_string())?.try_collect().await?)); + context.fetch_answer = fetch_answer; Ok(()) } diff --git a/rust/tests/integration/queries.rs b/rust/tests/integration/queries.rs index 9f50b734c7..37811e78ac 100644 --- a/rust/tests/integration/queries.rs +++ b/rust/tests/integration/queries.rs @@ -180,6 +180,7 @@ test_for_each_arg! { let age = unwrap_long(age?.map.remove("age").unwrap()); assert_eq!(age, 1); } + drop(ages); drop(transaction); let transaction = session.transaction(Read).await?;