pub struct Mapped<F, V: 'static, U: 'static> { /* private fields */ }Expand description
A converted view of a field: an ISO string as a date, #RRGGBB as a color, an index into a
table as the value it names. Copy, and still a binding, so it goes straight into a control.
Implementations§
Trait Implementations§
Source§impl<F: Source<V>, V: Clone + Default + 'static, U: Clone + 'static> Binding<U> for Mapped<F, V, U>
The missing case converts the stored type’s default rather than requiring the UI type to have
one: a Color has no Default, and asking every converted type for one would be a tax paid
by every caller for a case only a deleted row reaches.
impl<F: Source<V>, V: Clone + Default + 'static, U: Clone + 'static> Binding<U> for Mapped<F, V, U>
The missing case converts the stored type’s default rather than requiring the UI type to have
one: a Color has no Default, and asking every converted type for one would be a tax paid
by every caller for a case only a deleted row reaches.
Source§fn read(&self) -> U
fn read(&self) -> U
Tracked read: the current value, subscribing the running computation to changes.
Source§fn peek(&self) -> U
fn peek(&self) -> U
Untracked read: the current value, subscribing nothing (the reactive world’s “peek”).
Source§fn write_preview(&self, u: U)
fn write_preview(&self, u: U)
A live write mid-gesture (
Event::ValueChanged): readers must follow, but nothing
durable should key off it. Defaults to Binding::write: a plain signal has no
notion of “durable”, and a degraded backend that never commits stays correct.Source§fn write_commit(&self, u: U)
fn write_commit(&self, u: U)
The settled value that ends a gesture (
Event::ValueCommitted). Defaults to
Binding::write; a day-model field seals its preview session here: one change
record, one undo unit, one UPDATE for the whole drag.Source§fn write_teardown(&self, v: T)
fn write_teardown(&self, v: T)
Seal the last preview when its control is disposed. Persistent bindings default to
committing; scope-owned signals have already received the preview and may be gone.
impl<F: Copy, V, U> Copy for Mapped<F, V, U>
Auto Trait Implementations§
impl<F, V, U> Freeze for Mapped<F, V, U>where
F: Freeze,
impl<F, V, U> RefUnwindSafe for Mapped<F, V, U>where
F: RefUnwindSafe,
impl<F, V, U> Send for Mapped<F, V, U>where
F: Send,
impl<F, V, U> Sync for Mapped<F, V, U>where
F: Sync,
impl<F, V, U> Unpin for Mapped<F, V, U>where
F: Unpin,
impl<F, V, U> UnsafeUnpin for Mapped<F, V, U>where
F: UnsafeUnpin,
impl<F, V, U> UnwindSafe for Mapped<F, V, U>where
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