Trait re_viewer_context::ViewState
source · pub trait ViewState: Any + Sync + Send {
// Required methods
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
}
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
fn as_any(&self) -> &dyn Any
Converts itself to a reference of std::any::Any
, which enables downcasting to concrete types.
sourcefn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
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: ViewState>(&self) -> Result<&T, ViewSystemExecutionError>
fn downcast_ref<T: ViewState>(&self) -> Result<&T, ViewSystemExecutionError>
Downcasts this state to a reference of a concrete type.
source§fn downcast_mut<T: ViewState>(
&mut self,
) -> Result<&mut T, ViewSystemExecutionError>
fn downcast_mut<T: ViewState>( &mut self, ) -> Result<&mut T, ViewSystemExecutionError>
Downcasts this state to a mutable reference of a concrete type.