Skip to main content

Entity

Trait Entity 

Source
pub trait Entity: Send + Sync {
    type Id: Clone + Eq + Send + Sync;

    // Required method
    fn id(&self) -> &Self::Id;
}
Expand description

A domain object with a stable identity.

Required Associated Types§

Source

type Id: Clone + Eq + Send + Sync

Identifier type used by the entity.

Required Methods§

Source

fn id(&self) -> &Self::Id

Returns the stable identifier of this entity.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§