pub trait SignalExt: Sized + Signal {
// Provided methods
fn map<F, Output>(self, f: F) -> Map<Self, F, Output>
where F: 'static + Clone + Fn(Self::Output) -> Output,
Output: 'static,
Self: 'static { ... }
fn zip<B>(self, b: B) -> Zip<Self, B>
where B: Signal,
Self::Output: Clone,
<B as Signal>::Output: Clone { ... }
fn cached(self) -> Cached<Self>
where Self::Output: Clone { ... }
fn computed(self) -> Computed<Self::Output>
where Self: 'static { ... }
fn with<T>(self, metadata: T) -> WithMetadata<Self, T> { ... }
fn debounce(self, duration: Duration) -> Debounce<Self, DefaultExecutor>
where Self::Output: Clone { ... }
fn throttle(self, duration: Duration) -> Throttle<Self, DefaultExecutor>
where Self::Output: Clone { ... }
}Expand description
Extension trait providing convenient methods for all Signal types.
This trait adds utility methods to any type implementing Signal, allowing for easy chaining of operations like mapping, zipping, and caching.
Provided Methods§
Sourcefn map<F, Output>(self, f: F) -> Map<Self, F, Output>
fn map<F, Output>(self, f: F) -> Map<Self, F, Output>
Transforms the output of this signal using the provided function.
Sourcefn cached(self) -> Cached<Self>
fn cached(self) -> Cached<Self>
Wraps this signal with caching to avoid redundant computations.
Sourcefn computed(self) -> Computed<Self::Output>where
Self: 'static,
fn computed(self) -> Computed<Self::Output>where
Self: 'static,
Converts this signal into a type-erased Computed container.
Sourcefn with<T>(self, metadata: T) -> WithMetadata<Self, T>
fn with<T>(self, metadata: T) -> WithMetadata<Self, T>
Attaches metadata to this signal’s watcher notifications.
Sourcefn debounce(self, duration: Duration) -> Debounce<Self, DefaultExecutor>
fn debounce(self, duration: Duration) -> Debounce<Self, DefaultExecutor>
Creates a debounced version of this signal.
The debounced signal will only emit values after the specified duration has passed without receiving new values.
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.