pub enum UIParam<T: Send + Sync + 'static> {
Static(T),
Dynamic(WeakVar<T>),
}Expand description
A type that allows widgets to accept either dynamic or static parameters.
For example:
ⓘ
fn example(param: impl Into<UIParam<bool>>) { ... }
// `example` can be called with a constant
example(true);
// ... or with a reactive variable.
let my_var = Var::new(true);
example(*my_var);Variants§
Implementations§
Trait Implementations§
impl<T: Copy + Send + Sync + 'static> Copy for UIParam<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for UIParam<T>
impl<T> !UnwindSafe for UIParam<T>
impl<T> Freeze for UIParam<T>where
T: Freeze,
impl<T> Send for UIParam<T>
impl<T> Sync for UIParam<T>
impl<T> Unpin for UIParam<T>where
T: Unpin,
impl<T> UnsafeUnpin for UIParam<T>where
T: UnsafeUnpin,
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