View

Trait View 

Source
pub trait View {
    type Model: Model;
    type Mutable: Mutable;

    // Required methods
    fn entity(&self) -> &Entity;
    fn from_entity(inner: Entity) -> Self;
    fn to_model(&self) -> Result<Self::Model, PropertyError>;

    // Provided methods
    fn id(&self) -> EntityId { ... }
    fn collection() -> CollectionId { ... }
}
Expand description

A read only view of an Entity which offers typed accessors

Required Associated Types§

Required Methods§

Source

fn entity(&self) -> &Entity

Source

fn from_entity(inner: Entity) -> Self

Source

fn to_model(&self) -> Result<Self::Model, PropertyError>

Provided Methods§

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§