Mutable

Trait Mutable 

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

    // Required methods
    fn entity(&self) -> &Entity;
    fn new(entity: Entity) -> Self
       where Self: Sized;

    // Provided methods
    fn id(&self) -> EntityId { ... }
    fn collection() -> CollectionId { ... }
    fn state(&self) -> Result<State, StateError> { ... }
    fn read(&self) -> Self::View { ... }
}
Expand description

A mutable Model instance for an Entity with typed accessors. It is associated with a transaction, and may not outlive said transaction.

Required Associated Types§

Required Methods§

Source

fn entity(&self) -> &Entity

Source

fn new(entity: Entity) -> Self
where Self: Sized,

Provided Methods§

Source

fn id(&self) -> EntityId

Source

fn collection() -> CollectionId

Source

fn state(&self) -> Result<State, StateError>

Source

fn read(&self) -> Self::View

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§