pub struct Debug<C> { /* private fields */ }Expand description
A debug wrapper for Signal that logs computation events.
This struct wraps a Signal and provides configurable logging for various events like computation, watcher registration/removal, and value changes.
Implementations§
Source§impl<C> Debug<C>
impl<C> Debug<C>
Sourcepub fn with_config(source: C, config: Config) -> Self
pub fn with_config(source: C, config: Config) -> Self
Creates a new debug wrapper with the specified configuration.
Sourcepub fn changes(source: C) -> Self
pub fn changes(source: C) -> Self
Creates a debug wrapper that logs value changes only.
This is the most common debugging scenario - tracking when values change.
Sourcepub fn verbose(source: C) -> Self
pub fn verbose(source: C) -> Self
Creates a debug wrapper that logs all operations.
Includes computation, watcher registration/removal, and value changes.
Sourcepub fn compute_only(source: C) -> Self
pub fn compute_only(source: C) -> Self
Creates a debug wrapper that only logs computations.
Sourcepub fn compute_and_changes(source: C) -> Self
pub fn compute_and_changes(source: C) -> Self
Creates a debug wrapper that logs both computations and changes.
Trait Implementations§
Source§impl<C> Signal for Debug<C>
impl<C> Signal for Debug<C>
Source§type Guard = Box<dyn WatcherGuard>
type Guard = Box<dyn WatcherGuard>
The guard type returned by the watch method that manages watcher lifecycle.
Source§fn snapshot(&self) -> Self::Output
fn snapshot(&self) -> Self::Output
Takes a snapshot of the computation’s current value. Read more
Source§fn watch(&self, watcher: impl Fn(Context<C::Output>) + 'static) -> Self::Guard
fn watch(&self, watcher: impl Fn(Context<C::Output>) + 'static) -> Self::Guard
Register a watcher to be notified when the computed value changes. Read more
Auto Trait Implementations§
impl<C> !RefUnwindSafe for Debug<C>
impl<C> !Send for Debug<C>
impl<C> !Sync for Debug<C>
impl<C> !UnwindSafe for Debug<C>
impl<C> Freeze for Debug<C>where
C: Freeze,
impl<C> Unpin for Debug<C>where
C: Unpin,
impl<C> UnsafeUnpin for Debug<C>where
C: UnsafeUnpin,
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<C, F, T1, T2, Output> FlattenMap<F, (T1, T2), Output> for C
impl<C, F, T1, T2, Output> FlattenMap<F, (T1, T2), Output> for C
Source§impl<C, F, T1, T2, T3, Output> FlattenMap<F, (T1, T2, T3), Output> for C
impl<C, F, T1, T2, T3, Output> FlattenMap<F, (T1, T2, T3), Output> for C
Source§impl<T> IdentifiableExt for T
impl<T> IdentifiableExt for T
Source§impl<C, Output> IntoComputed<Output> for Cwhere
Output: 'static,
C: IntoSignal<Output> + 'static,
<C as IntoSignal<Output>>::Signal: Clone + 'static,
impl<C, Output> IntoComputed<Output> for Cwhere
Output: 'static,
C: IntoSignal<Output> + 'static,
<C as IntoSignal<Output>>::Signal: Clone + 'static,
Source§fn into_computed(self) -> Computed<Output>
fn into_computed(self) -> Computed<Output>
Convert this value into a Computed<Output>.
Source§impl<C, Output> IntoSignal<Output> for C
impl<C, Output> IntoSignal<Output> for C
Source§impl<C> SignalExt for Cwhere
C: Signal,
impl<C> SignalExt for Cwhere
C: Signal,
Source§fn 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.
Source§fn zip<B>(&self, b: &B) -> Zip<Self, B>
fn zip<B>(&self, b: &B) -> Zip<Self, B>
Combines this signal with another signal into a tuple.
Source§fn cached(&self) -> Cached<Self>
fn cached(&self) -> Cached<Self>
Wraps this signal with caching to avoid redundant computations.
Source§fn 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.Source§fn with<T: 'static>(&self, metadata: T) -> WithMetadata<Self, T>
fn with<T: 'static>(&self, metadata: T) -> WithMetadata<Self, T>
Attaches metadata to this signal’s watcher notifications.
Source§fn map_into<U>(&self) -> Map<Self, fn(Self::Output) -> U, U>
fn map_into<U>(&self) -> Map<Self, fn(Self::Output) -> U, U>
Transforms the output using
Into::into.Source§fn inspect<F>(
&self,
f: F,
) -> Map<Self, impl 'static + Clone + Fn(Self::Output) -> Self::Output, Self::Output>
fn inspect<F>( &self, f: F, ) -> Map<Self, impl 'static + Clone + Fn(Self::Output) -> Self::Output, Self::Output>
Applies a side-effect function and returns the original value.
Source§fn distinct(&self) -> Distinct<Self>
fn distinct(&self) -> Distinct<Self>
Creates a distinct signal that only notifies on value changes.
Source§fn equal_to(
&self,
other: Self::Output,
) -> Map<Self, impl 'static + Clone + Fn(Self::Output) -> bool, bool>
fn equal_to( &self, other: Self::Output, ) -> Map<Self, impl 'static + Clone + Fn(Self::Output) -> bool, bool>
Returns
true if the value equals the given value. Read moreSource§fn condition<F>(
&self,
predicate: F,
) -> Map<Self, impl 'static + Clone + Fn(Self::Output) -> bool, bool>
fn condition<F>( &self, predicate: F, ) -> Map<Self, impl 'static + Clone + Fn(Self::Output) -> bool, bool>
Returns
true if the predicate returns true for the value.Source§fn gt(
&self,
other: Self::Output,
) -> Map<Self, impl 'static + Clone + Fn(Self::Output) -> bool, bool>
fn gt( &self, other: Self::Output, ) -> Map<Self, impl 'static + Clone + Fn(Self::Output) -> bool, bool>
Returns
true if the value is greater than the given value.Source§fn lt(
&self,
other: Self::Output,
) -> Map<Self, impl 'static + Clone + Fn(Self::Output) -> bool, bool>
fn lt( &self, other: Self::Output, ) -> Map<Self, impl 'static + Clone + Fn(Self::Output) -> bool, bool>
Returns
true if the value is less than the given value.Source§fn ge(
&self,
other: Self::Output,
) -> Map<Self, impl 'static + Clone + Fn(Self::Output) -> bool, bool>
fn ge( &self, other: Self::Output, ) -> Map<Self, impl 'static + Clone + Fn(Self::Output) -> bool, bool>
Returns
true if the value is greater than or equal to the given value.Source§fn le(
&self,
other: Self::Output,
) -> Map<Self, impl 'static + Clone + Fn(Self::Output) -> bool, bool>
fn le( &self, other: Self::Output, ) -> Map<Self, impl 'static + Clone + Fn(Self::Output) -> bool, bool>
Returns
true if the value is less than or equal to the given value.Source§fn is_some<T>(&self) -> Map<Self, fn(Option<T>) -> bool, bool>
fn is_some<T>(&self) -> Map<Self, fn(Option<T>) -> bool, bool>
Returns
true if the Option is Some.Source§fn is_none<T>(&self) -> Map<Self, fn(Option<T>) -> bool, bool>
fn is_none<T>(&self) -> Map<Self, fn(Option<T>) -> bool, bool>
Returns
true if the Option is None.Source§fn unwrap_or<T>(
&self,
default: T,
) -> Map<Self, impl 'static + Clone + Fn(Option<T>) -> T, T>
fn unwrap_or<T>( &self, default: T, ) -> Map<Self, impl 'static + Clone + Fn(Option<T>) -> T, T>
Returns the contained value or a default.
Source§fn unwrap_or_else<T, F>(
&self,
default: F,
) -> Map<Self, impl 'static + Clone + Fn(Option<T>) -> T, T>
fn unwrap_or_else<T, F>( &self, default: F, ) -> Map<Self, impl 'static + Clone + Fn(Option<T>) -> T, T>
Returns the contained value or computes it from a closure.
Source§fn unwrap_or_default<T>(&self) -> Map<Self, fn(Option<T>) -> T, T>
fn unwrap_or_default<T>(&self) -> Map<Self, fn(Option<T>) -> T, T>
Returns the contained value or the default value for that type.
Source§fn some_equal_to<T>(
&self,
value: T,
) -> Map<Self, impl 'static + Clone + Fn(Option<T>) -> bool, bool>
fn some_equal_to<T>( &self, value: T, ) -> Map<Self, impl 'static + Clone + Fn(Option<T>) -> bool, bool>
Returns
true if the Option is Some and the value equals the given value.Source§fn flatten<T>(&self) -> Map<Self, fn(Option<Option<T>>) -> Option<T>, Option<T>>
fn flatten<T>(&self) -> Map<Self, fn(Option<Option<T>>) -> Option<T>, Option<T>>
Flattens a nested
Option<Option<T>> into Option<T>.Source§fn map_some<T, U, F>(
&self,
f: F,
) -> Map<Self, impl 'static + Clone + Fn(Option<T>) -> Option<U>, Option<U>>
fn map_some<T, U, F>( &self, f: F, ) -> Map<Self, impl 'static + Clone + Fn(Option<T>) -> Option<U>, Option<U>>
Maps an
Option<T> to Option<U> using the provided function.Source§fn and_then_some<T, U, F>(
&self,
f: F,
) -> Map<Self, impl 'static + Clone + Fn(Option<T>) -> Option<U>, Option<U>>
fn and_then_some<T, U, F>( &self, f: F, ) -> Map<Self, impl 'static + Clone + Fn(Option<T>) -> Option<U>, Option<U>>
Returns
None if the option is None, otherwise calls f with the wrapped value and returns the result.Source§fn not(&self) -> Map<Self, fn(bool) -> bool, bool>
fn not(&self) -> Map<Self, fn(bool) -> bool, bool>
Returns the logical negation of the boolean value.
Source§fn and<B>(&self, other: &B) -> Map<Zip<Self, B>, fn((bool, bool)) -> bool, bool>
fn and<B>(&self, other: &B) -> Map<Zip<Self, B>, fn((bool, bool)) -> bool, bool>
Returns the logical AND of this signal with another boolean signal.
Source§fn or<B>(&self, other: &B) -> Map<Zip<Self, B>, fn((bool, bool)) -> bool, bool>
fn or<B>(&self, other: &B) -> Map<Zip<Self, B>, fn((bool, bool)) -> bool, bool>
Returns the logical OR of this signal with another boolean signal.
Source§fn then_some<T>(
&self,
value: T,
) -> Map<Self, impl 'static + Clone + Fn(bool) -> Option<T>, Option<T>>
fn then_some<T>( &self, value: T, ) -> Map<Self, impl 'static + Clone + Fn(bool) -> Option<T>, Option<T>>
Returns
Some(value) if true, otherwise None.Source§fn select<T>(
&self,
if_true: T,
if_false: T,
) -> Map<Self, impl 'static + Clone + Fn(bool) -> T, T>
fn select<T>( &self, if_true: T, if_false: T, ) -> Map<Self, impl 'static + Clone + Fn(bool) -> T, T>
Returns
if_true if true, otherwise if_false.Source§fn sign<T>(&self) -> Map<Self, fn(T) -> bool, bool>
fn sign<T>(&self) -> Map<Self, fn(T) -> bool, bool>
Returns
true if the value is not negative (i.e., positive or zero).Source§fn is_positive<T>(&self) -> Map<Self, fn(T) -> bool, bool>
fn is_positive<T>(&self) -> Map<Self, fn(T) -> bool, bool>
Returns
true if the value is positive.Source§fn is_negative<T>(&self) -> Map<Self, fn(T) -> bool, bool>
fn is_negative<T>(&self) -> Map<Self, fn(T) -> bool, bool>
Returns
true if the value is negative.Source§fn is_ok<T, E>(&self) -> Map<Self, fn(Result<T, E>) -> bool, bool>
fn is_ok<T, E>(&self) -> Map<Self, fn(Result<T, E>) -> bool, bool>
Returns
true if the Result is Ok.Source§fn is_err<T, E>(&self) -> Map<Self, fn(Result<T, E>) -> bool, bool>
fn is_err<T, E>(&self) -> Map<Self, fn(Result<T, E>) -> bool, bool>
Returns
true if the Result is Err.Source§fn ok<T, E>(&self) -> Map<Self, fn(Result<T, E>) -> Option<T>, Option<T>>
fn ok<T, E>(&self) -> Map<Self, fn(Result<T, E>) -> Option<T>, Option<T>>
Converts from
Result<T, E> to Option<T>.Source§fn err<T, E>(&self) -> Map<Self, fn(Result<T, E>) -> Option<E>, Option<E>>
fn err<T, E>(&self) -> Map<Self, fn(Result<T, E>) -> Option<E>, Option<E>>
Converts from
Result<T, E> to Option<E>.Source§fn unwrap_or_result<T, E>(
&self,
default: T,
) -> Map<Self, impl 'static + Clone + Fn(Result<T, E>) -> T, T>
fn unwrap_or_result<T, E>( &self, default: T, ) -> Map<Self, impl 'static + Clone + Fn(Result<T, E>) -> T, T>
Returns the contained
Ok value or a default.Source§fn unwrap_or_else_result<T, E, F>(
&self,
f: F,
) -> Map<Self, impl 'static + Clone + Fn(Result<T, E>) -> T, T>
fn unwrap_or_else_result<T, E, F>( &self, f: F, ) -> Map<Self, impl 'static + Clone + Fn(Result<T, E>) -> T, T>
Returns the contained
Ok value or computes it from the error.Source§fn map_ok<T, E, U, F>(
&self,
f: F,
) -> Map<Self, impl 'static + Clone + Fn(Result<T, E>) -> Result<U, E>, Result<U, E>>
fn map_ok<T, E, U, F>( &self, f: F, ) -> Map<Self, impl 'static + Clone + Fn(Result<T, E>) -> Result<U, E>, Result<U, E>>
Maps a
Result<T, E> to Result<U, E> using the provided function.Source§fn map_err<T, E, F, U>(
&self,
f: F,
) -> Map<Self, impl 'static + Clone + Fn(Result<T, E>) -> Result<T, U>, Result<T, U>>
fn map_err<T, E, F, U>( &self, f: F, ) -> Map<Self, impl 'static + Clone + Fn(Result<T, E>) -> Result<T, U>, Result<T, U>>
Maps a
Result<T, E> to Result<T, F> using the provided function.Source§fn debounce(&self, duration: Duration) -> Debounce<Self, DefaultExecutor>
fn debounce(&self, duration: Duration) -> Debounce<Self, DefaultExecutor>
Creates a debounced version of this signal. Read more
Source§fn throttle(&self, duration: Duration) -> Throttle<Self, DefaultExecutor>
fn throttle(&self, duration: Duration) -> Throttle<Self, DefaultExecutor>
Creates a throttled version of this signal. Read more
Source§fn str_is_empty<T>(&self) -> Map<Self, fn(T) -> bool, bool>
fn str_is_empty<T>(&self) -> Map<Self, fn(T) -> bool, bool>
Returns
true if the string is empty. Read more