pub struct Computed<T>(/* private fields */);Expand description
A wrapper around a boxed implementation of the ComputedImpl trait.
This type represents a computation that can be evaluated to produce a result of type T.
The computation is stored as a boxed trait object, allowing for dynamic dispatch.
Implementations§
Trait Implementations§
Source§impl<T, C2> Add<C2> for Computed<T>
impl<T, C2> Add<C2> for Computed<T>
Source§impl<T> Debug for Computed<T>
Implements Debug for Computed<T>.
impl<T> Debug for Computed<T>
Implements Debug for Computed<T>.
This just outputs the type name rather than any internal details.
Source§impl<T> Default for Computed<T>
Implements Default for Computed<T> when T implements Default.
impl<T> Default for Computed<T>
Implements Default for Computed<T> when T implements Default.
This creates a constant computation with the default value of T.
Source§impl<T> Signal for Computed<T>where
T: 'static,
Implements Compute for Computed<T>.
impl<T> Signal for Computed<T>where
T: 'static,
Implements Compute for Computed<T>.
This delegates to the internal boxed implementation.
Auto Trait Implementations§
impl<T> Freeze for Computed<T>
impl<T> !RefUnwindSafe for Computed<T>
impl<T> !Send for Computed<T>
impl<T> !Sync for Computed<T>
impl<T> Unpin for Computed<T>
impl<T> !UnwindSafe for Computed<T>
Blanket Implementations§
Source§impl<S> AnimationExt for Swhere
S: SignalExt,
impl<S> AnimationExt for Swhere
S: SignalExt,
Source§fn animated(self) -> WithMetadata<Self, Animation>where
Self: Sized,
fn animated(self) -> WithMetadata<Self, Animation>where
Self: Sized,
Apply default animation to this reactive value Read more
Source§fn with_animation(self, animation: Animation) -> WithMetadata<Self, Animation>where
Self: Sized,
fn with_animation(self, animation: Animation) -> WithMetadata<Self, Animation>where
Self: Sized,
Apply a specific animation to this reactive value Read more
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 computation using the provided function. Read more
Source§fn zip<B: Signal>(self, b: B) -> Zip<Self, B>
fn zip<B: Signal>(self, b: B) -> Zip<Self, B>
Combines this computation with another computation. Read more
Source§fn computed(self) -> Computed<Self::Output>where
Self: Clone + 'static,
fn computed(self) -> Computed<Self::Output>where
Self: Clone + 'static,
Converts this computation into a
Computed wrapper. Read moreSource§fn with<T>(self, metadata: T) -> WithMetadata<Self, T>
fn with<T>(self, metadata: T) -> WithMetadata<Self, T>
Attaches metadata to this computation. Read more
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 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>(self, metadata: T) -> WithMetadata<Self, T>
fn with<T>(self, metadata: T) -> WithMetadata<Self, T>
Attaches metadata to this signal’s watcher notifications.
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn metadata<T: MetadataKey>(self, metadata: T) -> Metadata<T>
fn metadata<T: MetadataKey>(self, metadata: T) -> Metadata<T>
Attaches metadata to a view. Read more
Source§fn with<T: 'static>(self, value: T) -> With<Self, T>
fn with<T: 'static>(self, value: T) -> With<Self, T>
Associates a value with this view in the environment.
Source§fn title(self, title: impl Into<Text>) -> NavigationView
fn title(self, title: impl Into<Text>) -> NavigationView
Sets this view as the content of a navigation view with the specified title. Read more
Source§fn focused<T: 'static + Eq + Clone>(
self,
value: &Binding<Option<T>>,
equals: T,
) -> Metadata<Focused>
fn focused<T: 'static + Eq + Clone>( self, value: &Binding<Option<T>>, equals: T, ) -> Metadata<Focused>
Marks this view as focused when the binding matches the specified value. Read more
Source§fn on_change<C, F>(self, source: &C, handler: F) -> OnChange<Self, C::Guard>
fn on_change<C, F>(self, source: &C, handler: F) -> OnChange<Self, C::Guard>
Monitors a signal for changes and triggers a handler when the signal’s value changes. Read more
Source§fn task<Fut>(self, task: Fut) -> Metadata<Retain>
fn task<Fut>(self, task: Fut) -> Metadata<Retain>
Spawns an asynchronous task tied to the lifecycle of this view. Read more
Source§fn background(self, background: impl Into<Background>) -> Metadata<Background>
fn background(self, background: impl Into<Background>) -> Metadata<Background>
Sets the background of this view. Read more
Source§fn foreground(
self,
color: impl IntoComputed<Color>,
) -> Metadata<ForegroundColor>
fn foreground( self, color: impl IntoComputed<Color>, ) -> Metadata<ForegroundColor>
Sets the foreground color of this view. Read more
Source§fn event<H: 'static>(
self,
event: Event,
handler: impl HandlerFnOnce<H, ()> + 'static,
) -> Metadata<OnEvent>
fn event<H: 'static>( self, event: Event, handler: impl HandlerFnOnce<H, ()> + 'static, ) -> Metadata<OnEvent>
Adds an event handler for the specified event. Read more
Source§fn on_disappear<H: 'static>(
self,
handler: impl HandlerFnOnce<H, ()> + 'static,
) -> Metadata<OnEvent>
fn on_disappear<H: 'static>( self, handler: impl HandlerFnOnce<H, ()> + 'static, ) -> Metadata<OnEvent>
Adds a handler that triggers when the view disappears. Read more
Source§fn on_appear<H: 'static>(
self,
handler: impl HandlerFnOnce<H, ()> + 'static,
) -> Metadata<OnEvent>
fn on_appear<H: 'static>( self, handler: impl HandlerFnOnce<H, ()> + 'static, ) -> Metadata<OnEvent>
Adds a handler that triggers when the view appears. Read more
Source§fn min_height(self, height: f32) -> Frame
fn min_height(self, height: f32) -> Frame
Applies a minimum height constraint.
Source§fn max_height(self, height: f32) -> Frame
fn max_height(self, height: f32) -> Frame
Applies a maximum height constraint.
Source§fn alignment(self, alignment: Alignment) -> Frame
fn alignment(self, alignment: Alignment) -> Frame
Aligns this view within its frame using the provided alignment.
Source§fn padding_with(self, edge: impl Into<EdgeInsets>) -> Padding
fn padding_with(self, edge: impl Into<EdgeInsets>) -> Padding
Adds padding to this view with custom edge insets. Read more
Source§fn tag<T>(self, tag: T) -> TaggedView<T, Self>
fn tag<T>(self, tag: T) -> TaggedView<T, Self>
Tags this view with a custom tag for identification. Read more
Source§fn a11y_label(
self,
label: impl Into<Str>,
) -> IgnorableMetadata<AccessibilityLabel>
fn a11y_label( self, label: impl Into<Str>, ) -> IgnorableMetadata<AccessibilityLabel>
Sets the accessibility label for this view. Read more
Source§fn a11y_role(
self,
role: AccessibilityRole,
) -> IgnorableMetadata<AccessibilityRole>
fn a11y_role( self, role: AccessibilityRole, ) -> IgnorableMetadata<AccessibilityRole>
Sets the accessibility role for this view. Read more
Source§fn gesture<P: 'static>(
self,
gesture: impl Into<Gesture>,
action: impl HandlerFn<P, ()> + 'static,
) -> Metadata<GestureObserver>
fn gesture<P: 'static>( self, gesture: impl Into<Gesture>, action: impl HandlerFn<P, ()> + 'static, ) -> Metadata<GestureObserver>
Observes a gesture and executes an action when the gesture is recognized. Read more
Source§fn on_tap<P: 'static>(
self,
action: impl HandlerFn<P, ()> + 'static,
) -> Metadata<GestureObserver>
fn on_tap<P: 'static>( self, action: impl HandlerFn<P, ()> + 'static, ) -> Metadata<GestureObserver>
Adds a tap gesture recognizer to this view that triggers the specified action. Read more
Source§fn shadow(self, shadow: impl Into<Shadow>) -> Metadata<Shadow>
fn shadow(self, shadow: impl Into<Shadow>) -> Metadata<Shadow>
Applies a shadow effect to this view.
Source§fn ignore_safe_area(self, edges: EdgeSet) -> Metadata<IgnoreSafeArea>
fn ignore_safe_area(self, edges: EdgeSet) -> Metadata<IgnoreSafeArea>
Extends this view’s bounds to ignore safe area insets on the specified edges. Read more