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§
Provided Methods§
fn id(&self) -> EntityId
fn collection() -> CollectionId
fn state(&self) -> Result<State, StateError>
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.