Trait acter_core::models::ActerModel

source ·
pub trait ActerModel: Debug {
    // Required methods
    fn indizes(&self, user_id: &UserId) -> Vec<String>;
    fn event_id(&self) -> &EventId;
    fn room_id(&self) -> &RoomId;
    async fn execute(self, store: &Store) -> Result<Vec<String>>;

    // Provided methods
    fn belongs_to(&self) -> Option<Vec<String>> { ... }
    fn capabilities(&self) -> &[Capability] { ... }
    fn transition(&mut self, model: &AnyActerModel) -> Result<bool> { ... }
    async fn redact(
        &self,
        store: &Store,
        redaction_model: RedactedActerModel,
    ) -> Result<Vec<String>> { ... }
}

Required Methods§

source

fn indizes(&self, user_id: &UserId) -> Vec<String>

source

fn event_id(&self) -> &EventId

The key to store this model under

source

fn room_id(&self) -> &RoomId

The room id this model belongs to

source

async fn execute(self, store: &Store) -> Result<Vec<String>>

The execution to run when this model is found.

Provided Methods§

source

fn belongs_to(&self) -> Option<Vec<String>>

The models to inform about this model as it belongs to that

source

fn capabilities(&self) -> &[Capability]

activate to enable commenting support for this type of model

source

fn transition(&mut self, model: &AnyActerModel) -> Result<bool>

handle transition from an external Item upon us

source

async fn redact( &self, store: &Store, redaction_model: RedactedActerModel, ) -> Result<Vec<String>>

The execution to run when this model is found.

Object Safety§

This trait is not object safe.

Implementors§