pub struct Signal<T>where
T: 'static,{ /* private fields */ }Expand description
A Copy, !Send reactive value handle (§4.2).
Implementations§
Source§impl<T> Signal<T>where
T: 'static,
impl<T> Signal<T>where
T: 'static,
pub fn new(value: T) -> Signal<T>
Sourcepub fn global(value: T) -> Signal<T>
pub fn global(value: T) -> Signal<T>
A process-global signal: allocated in the ROOT scope regardless of where the call
runs, so it never dies with a transient caller. Every lazily-initialized global
registry must use this, not Signal::new — a lazy global first touched inside a
presented cover / pushed page / when arm otherwise inherits that scope and is
disposed with it, and every later read panics (the day-l10n locale signal was the
observed case).
pub fn new_in(scope: Scope, value: T) -> Signal<T>
pub fn try_with<R>(self, f: impl FnOnce(&T) -> R) -> Option<R>
pub fn with_untracked<R>(self, f: impl FnOnce(&T) -> R) -> R
pub fn get(self) -> Twhere
T: Clone,
pub fn try_get(self) -> Option<T>where
T: Clone,
pub fn get_untracked(self) -> Twhere
T: Clone,
pub fn set(self, value: T)
pub fn set_if_changed(self, value: T)where
T: PartialEq,
pub fn update(self, f: impl FnOnce(&mut T))
Trait Implementations§
Source§impl IntoFocusBinding<FocusBoolMark> for Signal<bool>
impl IntoFocusBinding<FocusBoolMark> for Signal<bool>
Source§impl IntoFraction<SignalMark> for Signal<f64>
impl IntoFraction<SignalMark> for Signal<f64>
fn into_fraction(self) -> FractionSource
Source§impl<T: Clone + 'static> IntoReactive<T, SignalMark> for Signal<T>
impl<T: Clone + 'static> IntoReactive<T, SignalMark> for Signal<T>
fn into_reactive(self) -> Reactive<T>
Source§impl IntoText<SignalMark> for Signal<String>
impl IntoText<SignalMark> for Signal<String>
fn into_text(self) -> TextSource
impl<T> Copy for Signal<T>where
T: 'static,
impl IntoNumberFArg<SigM> for Signal<f64>
impl IntoNumberFArg<SigM> for Signal<i64>
Auto Trait Implementations§
impl<T> Freeze for Signal<T>
impl<T> RefUnwindSafe for Signal<T>where
T: RefUnwindSafe,
impl<T> !Send for Signal<T>
impl<T> !Sync for Signal<T>
impl<T> Unpin for Signal<T>
impl<T> UnsafeUnpin for Signal<T>
impl<T> UnwindSafe for Signal<T>where
T: RefUnwindSafe,
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> 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>
Converts
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>
Converts
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