pub trait StateRepr<U>where
U: RawState,{
type Repr<_V: RawState>;
// Required methods
fn get(&self) -> &U;
fn get_mut(&mut self) -> &mut U;
fn view(&self) -> Self::Repr<&U>;
fn view_mut(&mut self) -> Self::Repr<&mut U>;
// Provided methods
fn replace(&mut self, value: U) -> U { ... }
fn set(&mut self, value: U) { ... }
fn swap(&mut self, other: &mut Self) { ... }
fn take(&mut self) -> U
where U: Default { ... }
}
Expand description
The StateRepr
trait defines a common interface for any implemented representations of
state.
Required Associated Types§
Required Methods§
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.