Trait Entity

Source
pub trait Entity<IdType>: Clone + Debug {
    // Required method
    fn get_id(&self) -> IdType;
}
Expand description

Represents an entity that can be stored in the system. You have to implement this trait for your custom type to be able to store it. Keep in mind that different implementations may require additional type constraints.

Required Methods§

Source

fn get_id(&self) -> IdType

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§