pub struct Var<T> { /* private fields */ }
Implementations§
source§impl<T> Var<T>where
T: 'static,
impl<T> Var<T>where T: 'static,
pub fn new(value: T) -> Selfwhere T: Hash,
pub fn map<F, R>(&self, func: F) -> Computed<R>where F: Fn(&T) -> R + 'static, R: Hash + 'static,
pub fn get(&self, eval: &impl AsRef<Evaluation>) -> Ref<'_, T>
pub fn get_once(&self) -> Ref<'_, T>
pub fn set(&self, value: T)where T: Hash,
pub fn toggle(&self)where T: Toggle + Hash,
pub fn replace(&self, value: T) -> Twhere T: Hash,
pub fn update(&self, func: impl FnOnce(&mut T))where T: Hash,
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Var<T>
impl<T> !Send for Var<T>
impl<T> !Sync for Var<T>
impl<T> Unpin for Var<T>
impl<T> !UnwindSafe for Var<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