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>>>
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.