pub struct TwoWayBinding<T: Clone + PartialEq + 'static> { /* private fields */ }Expand description
Bidirectional binding between two Observables of the same type.
Changes to either observable propagate to the other. A re-entrancy guard prevents infinite update cycles.
Drop the TwoWayBinding to disconnect both directions.
Implementations§
Source§impl<T: Clone + PartialEq + 'static> TwoWayBinding<T>
impl<T: Clone + PartialEq + 'static> TwoWayBinding<T>
Sourcepub fn new(a: &Observable<T>, b: &Observable<T>) -> Self
pub fn new(a: &Observable<T>, b: &Observable<T>) -> Self
Create a two-way binding between a and b.
Initially syncs b to a’s current value. Subsequent changes to
either side propagate to the other.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for TwoWayBinding<T>
impl<T> !RefUnwindSafe for TwoWayBinding<T>
impl<T> !Send for TwoWayBinding<T>
impl<T> !Sync for TwoWayBinding<T>
impl<T> Unpin for TwoWayBinding<T>where
T: Unpin,
impl<T> !UnwindSafe for TwoWayBinding<T>
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