pub trait SignalWith<T> {
// Required method
fn id(&self) -> Id;
// Provided methods
fn with<O>(&self, f: impl FnOnce(&T) -> O) -> O
where T: 'static { ... }
fn with_untracked<O>(&self, f: impl FnOnce(&T) -> O) -> O
where T: 'static { ... }
fn try_with<O>(&self, f: impl FnOnce(Option<&T>) -> O) -> O
where T: 'static { ... }
fn try_with_untracked<O>(&self, f: impl FnOnce(Option<&T>) -> O) -> O
where T: 'static { ... }
}
Required Methods§
Provided Methods§
Sourcefn with<O>(&self, f: impl FnOnce(&T) -> O) -> Owhere
T: 'static,
fn with<O>(&self, f: impl FnOnce(&T) -> O) -> Owhere
T: 'static,
Applies a closure to the current value stored in the Signal, and subscribes to the current running effect to this Memo.
Sourcefn with_untracked<O>(&self, f: impl FnOnce(&T) -> O) -> Owhere
T: 'static,
fn with_untracked<O>(&self, f: impl FnOnce(&T) -> O) -> Owhere
T: 'static,
Applies a closure to the current value stored in the Signal, but it doesn’t subscribe to the current running effect.
Sourcefn try_with<O>(&self, f: impl FnOnce(Option<&T>) -> O) -> Owhere
T: 'static,
fn try_with<O>(&self, f: impl FnOnce(Option<&T>) -> O) -> Owhere
T: 'static,
If the signal isn’t disposed, applies a closure to the current value stored in the Signal. It subscribes to the current running effect.
Sourcefn try_with_untracked<O>(&self, f: impl FnOnce(Option<&T>) -> O) -> Owhere
T: 'static,
fn try_with_untracked<O>(&self, f: impl FnOnce(Option<&T>) -> O) -> Owhere
T: 'static,
If the signal isn’t disposed, applies a closure to the current value stored in the Signal, but it doesn’t subscribe to the current running effect.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.