Struct LocalStateWriter
pub struct LocalStateWriter<T> { /* private fields */ }Expand description
A background-safe LocalState mutation handle with event-loop wakeup.
Implementations§
§impl<T> LocalStateWriter<T>
impl<T> LocalStateWriter<T>
pub fn set(&self, value: T)
pub fn set(&self, value: T)
Replace the value and request synchronization and redraw.
The mutation is accepted only while the captured owner is open and its
revision namespace is not exhausted. The return value from
Self::try_set reports publication acceptance, not wake delivery or
scheduling.
pub fn try_set(&self, value: T) -> bool
pub fn try_set(&self, value: T) -> bool
As Self::set, reporting whether the replacement was accepted for
publication. false means the captured owner is closed or the
revision namespace is exhausted; no wake delivery or scheduling is
implied by true.
pub fn update(&self, update: impl FnOnce(&mut T))
pub fn update(&self, update: impl FnOnce(&mut T))
Mutate the value once and request synchronization and redraw.
The mutation is accepted only while the captured owner is open and its
revision namespace is not exhausted. The return value from
Self::try_update reports publication acceptance, not wake delivery
or scheduling.
pub fn try_update(&self, update: impl FnOnce(&mut T)) -> bool
pub fn try_update(&self, update: impl FnOnce(&mut T)) -> bool
As Self::update, reporting whether the mutation was accepted for
publication. false means the captured owner is closed or the
revision namespace is exhausted; the callback is not invoked. true
does not mean that a wake was delivered or scheduled.
Trait Implementations§
§impl<T> Clone for LocalStateWriter<T>
impl<T> Clone for LocalStateWriter<T>
§fn clone(&self) -> LocalStateWriter<T>
fn clone(&self) -> LocalStateWriter<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<T> Freeze for LocalStateWriter<T>
impl<T> RefUnwindSafe for LocalStateWriter<T>
impl<T> Send for LocalStateWriter<T>
impl<T> Sync for LocalStateWriter<T>
impl<T> Unpin for LocalStateWriter<T>
impl<T> UnsafeUnpin for LocalStateWriter<T>
impl<T> UnwindSafe for LocalStateWriter<T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more