pub trait ThingAPI: Sync + Send {
// Required methods
fn iid(&self) -> &IID;
fn is_inferred(&self) -> bool;
fn to_thing_cloned(&self) -> Thing;
fn is_deleted<'tx>(
&self,
transaction: &'tx Transaction<'_>,
) -> BoxPromise<'tx, Result<bool>>;
// Provided methods
fn delete<'tx>(
&self,
transaction: &'tx Transaction<'_>,
) -> BoxPromise<'tx, Result> { ... }
fn get_has<'tx>(
&self,
transaction: &'tx Transaction<'_>,
attribute_types: Vec<AttributeType>,
annotations: Vec<Annotation>,
) -> Result<BoxStream<'tx, Result<Attribute>>> { ... }
fn set_has<'tx>(
&self,
transaction: &'tx Transaction<'_>,
attribute: Attribute,
) -> BoxPromise<'tx, Result> { ... }
fn unset_has<'tx>(
&self,
transaction: &'tx Transaction<'_>,
attribute: Attribute,
) -> BoxPromise<'tx, Result> { ... }
fn get_relations<'tx>(
&self,
transaction: &'tx Transaction<'_>,
role_types: Vec<RoleType>,
) -> Result<BoxStream<'tx, Result<Relation>>> { ... }
fn get_playing<'tx>(
&self,
transaction: &'tx Transaction<'_>,
) -> Result<BoxStream<'tx, Result<RoleType>>> { ... }
}Required Methods§
Sourcefn is_inferred(&self) -> bool
fn is_inferred(&self) -> bool
fn to_thing_cloned(&self) -> Thing
Sourcefn is_deleted<'tx>(
&self,
transaction: &'tx Transaction<'_>,
) -> BoxPromise<'tx, Result<bool>>
fn is_deleted<'tx>( &self, transaction: &'tx Transaction<'_>, ) -> BoxPromise<'tx, Result<bool>>
Provided Methods§
Sourcefn delete<'tx>(
&self,
transaction: &'tx Transaction<'_>,
) -> BoxPromise<'tx, Result>
fn delete<'tx>( &self, transaction: &'tx Transaction<'_>, ) -> BoxPromise<'tx, Result>
Sourcefn get_has<'tx>(
&self,
transaction: &'tx Transaction<'_>,
attribute_types: Vec<AttributeType>,
annotations: Vec<Annotation>,
) -> Result<BoxStream<'tx, Result<Attribute>>>
fn get_has<'tx>( &self, transaction: &'tx Transaction<'_>, attribute_types: Vec<AttributeType>, annotations: Vec<Annotation>, ) -> Result<BoxStream<'tx, Result<Attribute>>>
Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.
§Arguments
transaction– The current transactionattribute_type– TheAttributeTypeto filter the attributes byattribute_types– TheAttributeTypes to filter the attributes byannotations– Only retrieve attributes with all givenAnnotations
§Examples
thing.get_has(transaction, attribute_type, annotations=vec![Annotation::Key]);