Struct viewbuilder::Signal
source · pub struct Signal<T> { /* private fields */ }Implementations§
source§impl<T: Clone + 'static> Signal<T>
impl<T: Clone + 'static> Signal<T>
sourcepub fn bind<O>(&self, handle: &Handle<O>, slot: impl Slot<O, T> + 'static)where
O: Object + 'static,
pub fn bind<O>(&self, handle: &Handle<O>, slot: impl Slot<O, T> + 'static)where
O: Object + 'static,
Examples found in repository?
More examples
examples/counter.rs (line 28)
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
async fn main() {
let rt = Runtime::default();
let _guard = rt.enter();
let a = Counter::default().spawn();
let b = Counter::default().spawn();
a.value_changed().bind(&b, Counter::set);
a.set(2);
rt.run().await;
assert_eq!(a.borrow().value, 2);
assert_eq!(b.borrow().value, 2);
}Auto Trait Implementations§
impl<T> RefUnwindSafe for Signal<T>where
T: RefUnwindSafe,
impl<T> Send for Signal<T>where
T: Send,
impl<T> Sync for Signal<T>where
T: Sync,
impl<T> Unpin for Signal<T>where
T: Unpin,
impl<T> UnwindSafe for Signal<T>where
T: 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