pub struct StateStore { /* private fields */ }Implementations§
Source§impl StateStore
impl StateStore
pub fn new() -> Self
Sourcepub fn begin_render(&self) -> RenderStateTransaction
pub fn begin_render(&self) -> RenderStateTransaction
Start an isolated render-state transaction.
Dropping the transaction leaves the committed store unchanged. Passing
it to StateStore::commit_render installs compatible state and removes
instances not reached during the successful render.
Sourcepub fn begin_render_scope(
&self,
scope: ComponentInstancePath,
) -> RenderStateTransaction
pub fn begin_render_scope( &self, scope: ComponentInstancePath, ) -> RenderStateTransaction
Start a transaction that reconciles only one component subtree. State belonging to other window roots remains untouched on commit.
pub fn commit_render(&mut self, transaction: RenderStateTransaction)
Sourcepub fn remove_scope(&mut self, scope: &ComponentInstancePath)
pub fn remove_scope(&mut self, scope: &ComponentInstancePath)
Remove one component subtree, including every descendant instance.
Sourcepub fn mount_instance(
&mut self,
path: ComponentInstancePath,
schema: &ComponentStateSchema,
) -> Result<StateReconcileReport, StateError>
pub fn mount_instance( &mut self, path: ComponentInstancePath, schema: &ComponentStateSchema, ) -> Result<StateReconcileReport, StateError>
Mount or reconcile one instance without cleaning any other path.
Used to make candidate component defaults readable during view.
§Errors
Returns invalid-schema/default errors.
pub fn get(&self, path: &ComponentInstancePath, field: &str) -> Option<&UiValue>
Sourcepub fn set(
&mut self,
path: &ComponentInstancePath,
field: &str,
value: UiValue,
) -> Result<bool, StateError>
pub fn set( &mut self, path: &ComponentInstancePath, field: &str, value: UiValue, ) -> Result<bool, StateError>
Update a declared field on a committed component instance.
§Errors
Returns StateError::UnknownInstance, StateError::UnknownField, or
StateError::InvalidValue when the update violates committed state.
pub fn instance_count(&self) -> usize
pub fn paths(&self) -> BTreeSet<ComponentInstancePath>
pub fn is_sensitive(&self, path: &ComponentInstancePath, field: &str) -> bool
pub fn inspect(&self) -> Vec<StateInstanceSnapshot>
Sourcepub fn inspect_instance(
&self,
path: &ComponentInstancePath,
) -> Option<StateInstanceSnapshot>
pub fn inspect_instance( &self, path: &ComponentInstancePath, ) -> Option<StateInstanceSnapshot>
Inspect one component instance without cloning unrelated component state.
Trait Implementations§
Source§impl Clone for StateStore
impl Clone for StateStore
Source§impl Debug for StateStore
impl Debug for StateStore
Auto Trait Implementations§
impl !Send for StateStore
impl !Sync for StateStore
impl Freeze for StateStore
impl RefUnwindSafe for StateStore
impl Unpin for StateStore
impl UnsafeUnpin for StateStore
impl UnwindSafe for StateStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<T> Variant for T
impl<T> Variant for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Variant trait object to &mut dyn Any.Source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Variant trait object to Box<dyn Any>.