Trait typedb_driver::transaction::concept::api::RelationAPI
source · pub trait RelationAPI: ThingAPI + Clone + Into<Relation> {
// Provided methods
fn add_role_player<'tx>(
&self,
transaction: &'tx Transaction<'_>,
role_type: RoleType,
player: Thing
) -> BoxPromise<'tx, Result> { ... }
fn remove_role_player<'tx>(
&self,
transaction: &'tx Transaction<'_>,
role_type: RoleType,
player: Thing
) -> BoxPromise<'tx, Result> { ... }
fn get_players_by_role_type<'tx>(
&self,
transaction: &'tx Transaction<'_>,
role_types: Vec<RoleType>
) -> Result<BoxStream<'tx, Result<Thing>>> { ... }
fn get_role_players<'tx>(
&self,
transaction: &'tx Transaction<'_>
) -> Result<BoxStream<'tx, Result<(RoleType, Thing)>>> { ... }
fn get_relating<'tx>(
&self,
transaction: &'tx Transaction<'_>
) -> Result<BoxStream<'tx, Result<RoleType>>> { ... }
}Provided Methods§
sourcefn add_role_player<'tx>(
&self,
transaction: &'tx Transaction<'_>,
role_type: RoleType,
player: Thing
) -> BoxPromise<'tx, Result>
fn add_role_player<'tx>( &self, transaction: &'tx Transaction<'_>, role_type: RoleType, player: Thing ) -> BoxPromise<'tx, Result>
sourcefn remove_role_player<'tx>(
&self,
transaction: &'tx Transaction<'_>,
role_type: RoleType,
player: Thing
) -> BoxPromise<'tx, Result>
fn remove_role_player<'tx>( &self, transaction: &'tx Transaction<'_>, role_type: RoleType, player: Thing ) -> BoxPromise<'tx, Result>
Removes the association of the given instance that plays the given role in this Relation.
Arguments
transaction– The current transactionrole_type– The role to no longer be played by the thing in thisRelationplayer– The instance to no longer play the role in thisRelation
Examples
relation.remove_role_player(transaction, role_type, player).await;sourcefn get_players_by_role_type<'tx>(
&self,
transaction: &'tx Transaction<'_>,
role_types: Vec<RoleType>
) -> Result<BoxStream<'tx, Result<Thing>>>
fn get_players_by_role_type<'tx>( &self, transaction: &'tx Transaction<'_>, role_types: Vec<RoleType> ) -> Result<BoxStream<'tx, Result<Thing>>>
sourcefn get_role_players<'tx>(
&self,
transaction: &'tx Transaction<'_>
) -> Result<BoxStream<'tx, Result<(RoleType, Thing)>>>
fn get_role_players<'tx>( &self, transaction: &'tx Transaction<'_> ) -> Result<BoxStream<'tx, Result<(RoleType, Thing)>>>
sourcefn get_relating<'tx>(
&self,
transaction: &'tx Transaction<'_>
) -> Result<BoxStream<'tx, Result<RoleType>>>
fn get_relating<'tx>( &self, transaction: &'tx Transaction<'_> ) -> Result<BoxStream<'tx, Result<RoleType>>>
Object Safety§
This trait is not object safe.