pub struct Map<R, F> { /* private fields */ }Expand description
A mapping type that transforms a resolvable value using a function.
Map wraps an existing Resolvable and applies a transformation function to its
resolved output. This enables fluent APIs like color.lighten(0.2) or
font.with_weight(Bold) without losing reactivity.
§Example
ⓘ
use waterui_core::resolve::Map;
// Create a lighter version of the accent color
let lighter_accent = Map::new(
theme::color::Accent,
|color| color.with_lightness(color.lightness() + 0.2)
);The transformation is applied lazily when the signal emits, so if the underlying
Accent color changes (e.g., dark mode toggle), the lighter version updates too.
Implementations§
Trait Implementations§
Source§impl<R, F, T, U> Resolvable for Map<R, F>
impl<R, F, T, U> Resolvable for Map<R, F>
Auto Trait Implementations§
impl<R, F> Freeze for Map<R, F>
impl<R, F> RefUnwindSafe for Map<R, F>where
R: RefUnwindSafe,
F: RefUnwindSafe,
impl<R, F> Send for Map<R, F>
impl<R, F> Sync for Map<R, F>
impl<R, F> Unpin for Map<R, F>
impl<R, F> UnwindSafe for Map<R, F>where
R: UnwindSafe,
F: UnwindSafe,
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