pub struct ValueListenableBuilder;Expand description
Builds from a ValueNotifier’s value, and again whenever it changes — the reference’s
ValueListenableBuilder.
use frus_widgets::{text, ValueListenableBuilder, ValueNotifier};
let count = ValueNotifier::new(0);
let label = ValueListenableBuilder::new(count.clone(), |_, n: &i32| Box::new(text(format!("{n}"))));
count.set(1); // the label shows 1 at the next frameImplementations§
Source§impl ValueListenableBuilder
impl ValueListenableBuilder
Sourcepub fn new<T: 'static>(
notifier: ValueNotifier<T>,
build: impl Fn(&BuildContext<'_>, &T) -> Box<dyn Widget> + 'static,
) -> Component
pub fn new<T: 'static>( notifier: ValueNotifier<T>, build: impl Fn(&BuildContext<'_>, &T) -> Box<dyn Widget> + 'static, ) -> Component
A component that builds from notifier’s value.
Auto Trait Implementations§
impl Freeze for ValueListenableBuilder
impl RefUnwindSafe for ValueListenableBuilder
impl Send for ValueListenableBuilder
impl Sync for ValueListenableBuilder
impl Unpin for ValueListenableBuilder
impl UnsafeUnpin for ValueListenableBuilder
impl UnwindSafe for ValueListenableBuilder
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