pub trait ActerModel: Debug {
// Required methods
fn event_meta(&self) -> &EventMeta;
fn indizes(&self, user_id: &UserId) -> Vec<IndexKey>;
async fn execute(
self,
store: &Store,
) -> Result<Vec<ExecuteReference>, Error>;
// Provided methods
fn event_id(&self) -> &EventId { ... }
fn room_id(&self) -> &RoomId { ... }
fn belongs_to(&self) -> Option<Vec<OwnedEventId>> { ... }
fn capabilities(&self) -> &[Capability] { ... }
fn transition(&mut self, model: &AnyActerModel) -> Result<bool, Error> { ... }
async fn redact(
&self,
store: &Store,
redaction_model: RedactedActerModel,
) -> Result<Vec<ExecuteReference>, Error> { ... }
}
Required Methods§
Sourcefn event_meta(&self) -> &EventMeta
fn event_meta(&self) -> &EventMeta
the event metadata for this model
fn indizes(&self, user_id: &UserId) -> Vec<IndexKey>
Provided Methods§
Sourcefn belongs_to(&self) -> Option<Vec<OwnedEventId>>
fn belongs_to(&self) -> Option<Vec<OwnedEventId>>
The models to inform about this model as it belongs to that
Sourcefn capabilities(&self) -> &[Capability]
fn capabilities(&self) -> &[Capability]
activate to enable commenting support for this type of model
Sourcefn transition(&mut self, model: &AnyActerModel) -> Result<bool, Error>
fn transition(&mut self, model: &AnyActerModel) -> Result<bool, Error>
handle transition from an external Item upon us
Sourceasync fn redact(
&self,
store: &Store,
redaction_model: RedactedActerModel,
) -> Result<Vec<ExecuteReference>, Error>
async fn redact( &self, store: &Store, redaction_model: RedactedActerModel, ) -> Result<Vec<ExecuteReference>, Error>
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.