pub trait AttributeTypeAPI:
ThingTypeAPI
+ Clone
+ Into<AttributeType> {
Show 13 methods
// Required method
fn value_type(&self) -> ValueType;
// Provided methods
fn put<'tx>(
&self,
transaction: &'tx Transaction<'_>,
value: Value,
) -> BoxPromise<'tx, Result<Attribute>> { ... }
fn get<'tx>(
&self,
transaction: &'tx Transaction<'_>,
value: Value,
) -> BoxPromise<'tx, Result<Option<Attribute>>> { ... }
fn get_supertype<'tx>(
&self,
transaction: &'tx Transaction<'_>,
) -> BoxPromise<'tx, Result<Option<AttributeType>>> { ... }
fn set_supertype<'tx>(
&mut self,
transaction: &'tx Transaction<'_>,
supertype: AttributeType,
) -> BoxPromise<'tx, Result> { ... }
fn get_supertypes<'tx>(
&self,
transaction: &'tx Transaction<'_>,
) -> Result<BoxStream<'tx, Result<AttributeType>>> { ... }
fn get_subtypes<'tx>(
&self,
transaction: &'tx Transaction<'_>,
transitivity: Transitivity,
) -> Result<BoxStream<'tx, Result<AttributeType>>> { ... }
fn get_subtypes_with_value_type<'tx>(
&self,
transaction: &'tx Transaction<'_>,
value_type: ValueType,
transitivity: Transitivity,
) -> Result<BoxStream<'tx, Result<AttributeType>>> { ... }
fn get_instances<'tx>(
&self,
transaction: &'tx Transaction<'_>,
transitivity: Transitivity,
) -> Result<BoxStream<'tx, Result<Attribute>>> { ... }
fn get_regex<'tx>(
&self,
transaction: &'tx Transaction<'_>,
) -> BoxPromise<'tx, Result<Option<String>>> { ... }
fn set_regex<'tx>(
&self,
transaction: &'tx Transaction<'_>,
regex: String,
) -> BoxPromise<'tx, Result> { ... }
fn unset_regex<'tx>(
&self,
transaction: &'tx Transaction<'_>,
) -> BoxPromise<'tx, Result> { ... }
fn get_owners<'tx>(
&self,
transaction: &'tx Transaction<'_>,
transitivity: Transitivity,
annotations: Vec<Annotation>,
) -> Result<BoxStream<'tx, Result<ThingType>>> { ... }
}Required Methods§
Sourcefn value_type(&self) -> ValueType
fn value_type(&self) -> ValueType
Provided Methods§
Sourcefn put<'tx>(
&self,
transaction: &'tx Transaction<'_>,
value: Value,
) -> BoxPromise<'tx, Result<Attribute>>
fn put<'tx>( &self, transaction: &'tx Transaction<'_>, value: Value, ) -> BoxPromise<'tx, Result<Attribute>>
Sourcefn get<'tx>(
&self,
transaction: &'tx Transaction<'_>,
value: Value,
) -> BoxPromise<'tx, Result<Option<Attribute>>>
fn get<'tx>( &self, transaction: &'tx Transaction<'_>, value: Value, ) -> BoxPromise<'tx, Result<Option<Attribute>>>
Sourcefn get_supertype<'tx>(
&self,
transaction: &'tx Transaction<'_>,
) -> BoxPromise<'tx, Result<Option<AttributeType>>>
fn get_supertype<'tx>( &self, transaction: &'tx Transaction<'_>, ) -> BoxPromise<'tx, Result<Option<AttributeType>>>
Sourcefn set_supertype<'tx>(
&mut self,
transaction: &'tx Transaction<'_>,
supertype: AttributeType,
) -> BoxPromise<'tx, Result>
fn set_supertype<'tx>( &mut self, transaction: &'tx Transaction<'_>, supertype: AttributeType, ) -> BoxPromise<'tx, Result>
Sourcefn get_supertypes<'tx>(
&self,
transaction: &'tx Transaction<'_>,
) -> Result<BoxStream<'tx, Result<AttributeType>>>
fn get_supertypes<'tx>( &self, transaction: &'tx Transaction<'_>, ) -> Result<BoxStream<'tx, Result<AttributeType>>>
Sourcefn get_subtypes<'tx>(
&self,
transaction: &'tx Transaction<'_>,
transitivity: Transitivity,
) -> Result<BoxStream<'tx, Result<AttributeType>>>
fn get_subtypes<'tx>( &self, transaction: &'tx Transaction<'_>, transitivity: Transitivity, ) -> Result<BoxStream<'tx, Result<AttributeType>>>
Retrieves all direct and indirect (or direct only) subtypes of this AttributeType.
§Arguments
transaction– The current transactiontransitivity–Transitivity::Transitivefor direct and indirect subtypes,Transitivity::Explicitfor direct subtypes only
§Examples
attribute_type.get_subtypes(transaction, transitivity)Sourcefn get_subtypes_with_value_type<'tx>(
&self,
transaction: &'tx Transaction<'_>,
value_type: ValueType,
transitivity: Transitivity,
) -> Result<BoxStream<'tx, Result<AttributeType>>>
fn get_subtypes_with_value_type<'tx>( &self, transaction: &'tx Transaction<'_>, value_type: ValueType, transitivity: Transitivity, ) -> Result<BoxStream<'tx, Result<AttributeType>>>
Retrieves all direct and indirect (or direct only) subtypes of this AttributeType
with given ValueType.
§Arguments
transaction– The current transactionvalue_type–ValueTypefor retrieving subtypestransitivity–Transitivity::Transitivefor direct and indirect subtypes,Transitivity::Explicitfor direct subtypes only
§Examples
attribute_type.get_subtypes_with_value_type(transaction, value_type, transitivity)Sourcefn get_instances<'tx>(
&self,
transaction: &'tx Transaction<'_>,
transitivity: Transitivity,
) -> Result<BoxStream<'tx, Result<Attribute>>>
fn get_instances<'tx>( &self, transaction: &'tx Transaction<'_>, transitivity: Transitivity, ) -> Result<BoxStream<'tx, Result<Attribute>>>
Retrieves all direct and indirect (or direct only) Attributes that are instances
of this AttributeType.
§Arguments
transaction– The current transactiontransitivity–Transitivity::Transitivefor direct and indirect subtypes,Transitivity::Explicitfor direct subtypes only
§Examples
attribute_type.get_instances(transaction, transitivity)Sourcefn get_regex<'tx>(
&self,
transaction: &'tx Transaction<'_>,
) -> BoxPromise<'tx, Result<Option<String>>>
fn get_regex<'tx>( &self, transaction: &'tx Transaction<'_>, ) -> BoxPromise<'tx, Result<Option<String>>>
Sourcefn set_regex<'tx>(
&self,
transaction: &'tx Transaction<'_>,
regex: String,
) -> BoxPromise<'tx, Result>
fn set_regex<'tx>( &self, transaction: &'tx Transaction<'_>, regex: String, ) -> BoxPromise<'tx, Result>
Sets a regular expression as a constraint for this AttributeType. Values of all
Attributes of this type (inserted earlier or later) should match this regex.
Can only be applied for AttributeTypes with a string value type.
§Arguments
transaction– The current transactionregex– Regular expression
§Examples
attribute_type.set_regex(transaction, regex).await;Sourcefn unset_regex<'tx>(
&self,
transaction: &'tx Transaction<'_>,
) -> BoxPromise<'tx, Result>
fn unset_regex<'tx>( &self, transaction: &'tx Transaction<'_>, ) -> BoxPromise<'tx, Result>
Sourcefn get_owners<'tx>(
&self,
transaction: &'tx Transaction<'_>,
transitivity: Transitivity,
annotations: Vec<Annotation>,
) -> Result<BoxStream<'tx, Result<ThingType>>>
fn get_owners<'tx>( &self, transaction: &'tx Transaction<'_>, transitivity: Transitivity, annotations: Vec<Annotation>, ) -> Result<BoxStream<'tx, Result<ThingType>>>
Retrieve all Things that own an attribute of this AttributeType
and have all given Annotations.
§Arguments
transaction– The current transactiontransitivity–Transitivity::Transitivefor direct and inherited ownership,Transitivity::Explicitfor direct ownership onlyannotations– Only retrieveThingTypesthat have an attribute of thisAttributeTypewith all givenAnnotations
§Examples
attribute_type.get_owners(transaction, transitivity, annotations)Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.