acter_core::models

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

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.

Implementors§