pub trait EntityTypeAPI: ThingTypeAPI + Clone + Into<EntityType> {
    // Provided methods
    fn create<'tx>(
        &self,
        transaction: &'tx Transaction<'_>
    ) -> BoxPromise<'tx, Result<Entity>> { ... }
    fn get_supertype<'tx>(
        &self,
        transaction: &'tx Transaction<'_>
    ) -> BoxPromise<'tx, Result<Option<EntityType>>> { ... }
    fn set_supertype<'tx>(
        &mut self,
        transaction: &'tx Transaction<'_>,
        supertype: EntityType
    ) -> BoxPromise<'tx, Result> { ... }
    fn get_supertypes<'tx>(
        &self,
        transaction: &'tx Transaction<'_>
    ) -> Result<BoxStream<'tx, Result<EntityType>>> { ... }
    fn get_subtypes<'tx>(
        &self,
        transaction: &'tx Transaction<'_>,
        transitivity: Transitivity
    ) -> Result<BoxStream<'tx, Result<EntityType>>> { ... }
    fn get_instances<'tx>(
        &self,
        transaction: &'tx Transaction<'_>,
        transitivity: Transitivity
    ) -> Result<BoxStream<'tx, Result<Entity>>> { ... }
}

Provided Methods§

source

fn create<'tx>( &self, transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result<Entity>>

Creates and returns a new instance of this EntityType.

§Arguments
  • transaction – The current transaction
§Examples
entity_type.create(transaction).await;
source

fn get_supertype<'tx>( &self, transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result<Option<EntityType>>>

Retrieves the most immediate supertype of the EntityType.

§Arguments
  • transaction – The current transaction
§Examples
entity_type.get_supertype(transaction).await;
source

fn set_supertype<'tx>( &mut self, transaction: &'tx Transaction<'_>, supertype: EntityType ) -> BoxPromise<'tx, Result>

Sets the supplied EntityType as the supertype of the current EntityType.

§Arguments
  • transaction – The current transaction
  • supertype – The EntityType to set as the supertype of this EntityType
§Examples
entity_type.set_supertype(transaction, super_entity_type).await;
source

fn get_supertypes<'tx>( &self, transaction: &'tx Transaction<'_> ) -> Result<BoxStream<'tx, Result<EntityType>>>

Retrieves all supertypes of the EntityType.

§Arguments
  • transaction – The current transaction
§Examples
entity_type.get_supertypes(transaction);
source

fn get_subtypes<'tx>( &self, transaction: &'tx Transaction<'_>, transitivity: Transitivity ) -> Result<BoxStream<'tx, Result<EntityType>>>

Retrieves all direct and indirect (or direct only) subtypes of the EntityType.

§Arguments
  • transaction – The current transaction
  • transitivityTransitivity::Transitive for direct and indirect subtypes, Transitivity::Explicit for direct subtypes only
§Examples
entity_type.get_subtypes(transaction, Transitivity::Transitive);
source

fn get_instances<'tx>( &self, transaction: &'tx Transaction<'_>, transitivity: Transitivity ) -> Result<BoxStream<'tx, Result<Entity>>>

Retrieves all direct and indirect (or direct only) Entity objects that are instances of this EntityType.

§Arguments
  • transaction – The current transaction
  • transitivityTransitivity::Transitive for direct and indirect instances, Transitivity::Explicit for direct instances only
§Examples
entity_type.get_instances(transaction, Transitivity::Explicit);

Object Safety§

This trait is not object safe.

Implementors§