pub struct StateContainer { /* private fields */ }
Expand description
State management for Orbit applications
This is the original state management system that is being enhanced with the reactive system. It’s kept for backward compatibility but new code should prefer the reactive system.
Implementations§
Source§impl StateContainer
impl StateContainer
Sourcepub fn create<T: 'static + Clone + Send + Sync>(&self, initial: T) -> State<T>
pub fn create<T: 'static + Clone + Send + Sync>(&self, initial: T) -> State<T>
Create a new state value
Sourcepub fn computed<T, F>(
&self,
compute: F,
dependencies: Vec<TypeId>,
) -> Computed<T>
pub fn computed<T, F>( &self, compute: F, dependencies: Vec<TypeId>, ) -> Computed<T>
Create computed state dependent on other state
Trait Implementations§
Source§impl Clone for StateContainer
impl Clone for StateContainer
Source§fn clone(&self) -> StateContainer
fn clone(&self) -> StateContainer
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StateContainer
impl Debug for StateContainer
Auto Trait Implementations§
impl Freeze for StateContainer
impl RefUnwindSafe for StateContainer
impl Send for StateContainer
impl Sync for StateContainer
impl Unpin for StateContainer
impl UnwindSafe for StateContainer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Event for T
impl<T> Event for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert to Any for downcasting (mutable)
Source§fn event_type(&self) -> &'static str
fn event_type(&self) -> &'static str
Get the event type name
Source§impl<T> Props for T
impl<T> Props for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert to mutable Any for downcasting