Skip to main content

ReadModel

Trait ReadModel 

Source
pub trait ReadModel:
    Serialize
    + DeserializeOwned
    + Clone
    + Send
    + Sync {
    const COLLECTION: &'static str;

    // Required method
    fn id(&self) -> &str;
}
Expand description

Trait implemented by the derive macro for read-model identity metadata.

Required Associated Constants§

Source

const COLLECTION: &'static str

The declared storage name for this read model type.

Required Methods§

Source

fn id(&self) -> &str

Returns the unique identifier for this read model instance.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§