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§
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
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.