pub enum Reactive<T>where
T: Clone + 'static,{
Const(T),
Dyn(Rc<dyn Fn() -> T>),
}Expand description
A parameter that is either a constant or a reactive source. get() is a tracked read, so any
Reactive used inside a canvas draw closure makes that shape re-record when the source changes.
Variants§
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Reactive<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Reactive<T>
impl<T> !Send for Reactive<T>
impl<T> !Sync for Reactive<T>
impl<T> Unpin for Reactive<T>where
T: Unpin,
impl<T> UnsafeUnpin for Reactive<T>where
T: UnsafeUnpin,
impl<T> !UnwindSafe for Reactive<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more