pub trait ViewState:
Any
+ Sync
+ Send {
// Required methods
fn as_any(&self) -> &(dyn Any + 'static);
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static);
}
Expand description
Unserialized frame to frame state of a view.
For any state that should be persisted, use the Blueprint! This state is used for transient state, such as animation or uncommitted ui state like dragging a camera. (on mouse release, the camera would be committed to the blueprint).
Required Methods§
Sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts itself to a reference of std::any::Any
, which enables downcasting to concrete types.
Sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts itself to a reference of std::any::Any
, which enables downcasting to concrete types.
Trait Implementations§
Source§impl ViewStateExt for dyn ViewState
impl ViewStateExt for dyn ViewState
Source§fn downcast_ref<T>(&self) -> Result<&T, ViewSystemExecutionError>where
T: ViewState,
fn downcast_ref<T>(&self) -> Result<&T, ViewSystemExecutionError>where
T: ViewState,
Downcasts this state to a reference of a concrete type.
Source§fn downcast_mut<T>(&mut self) -> Result<&mut T, ViewSystemExecutionError>where
T: ViewState,
fn downcast_mut<T>(&mut self) -> Result<&mut T, ViewSystemExecutionError>where
T: ViewState,
Downcasts this state to a mutable reference of a concrete type.