pub fn with_mut(&self, apply: impl FnOnce(&mut T)) {
        let mut new_val = self.value.as_ref().unwrap().as_ref().to_owned();
        apply(&mut new_val);
        self.set(new_val);
    }
/// Get a mutable handle to the value by calling `ToOwned::to_owned` on the
/// current value.
///
/// This is essentially cloning the underlying value and then setting it,
/// giving you a mutable handle in the process. This method is intended for
/// types that are cheaply cloneable.
///
/// If you are comfortable dealing with `RefMut`, then you can use `make_mut` to get
/// the underlying slot. However, be careful with `RefMut` since you might panic
/// if the `RefCell` is left open.
///
/// # Examples
///
/// ```
/// let val = use_state(&cx, || 0);
///
/// val.with_mut(|v| *v = 1);
/// ```
Get a mutable handle to the value by calling `ToOwned::to_owned` on the
current value.

This is essentially cloning the underlying value and then setting it,
giving you a mutable handle in the process. This method is intended for
types that are cheaply cloneable.

If you are comfortable dealing with `RefMut`, then you can use `make_mut` to get
the underlying slot. However, be careful with `RefMut` since you might panic
if the `RefCell` is left open.
Get a mutable handle to the value by calling ` ToOwned :: to_owned ` on the current value . This is essentially cloning the underlying value and then setting it giving you a mutable handle in the process . This method is intended for types that are cheaply cloneable . If you are comfortable dealing with ` RefMut ` then you can use ` make_mut ` to get the underlying slot . However be careful with ` RefMut ` since you might panic if the ` RefCell ` is left open .
pub fn with_mut(&self, apply: impl FnOnce(&mut T)) {
        let mut new_val = self.value.as_ref().unwrap().as_ref().to_owned();
        apply(&mut new_val);
        self.set(new_val);
    }
pub fn with_mut ( & self , apply : impl FnOnce ( & mut T ) ) { let mut new_val = self . value . as_ref ( ) . unwrap ( ) . as_ref ( ) . to_owned ( ) ; apply ( & mut new_val ) ; self . set ( new_val ) ; }
Get a mutable handle to the value by calling `ToOwned::to_owned` on the
current value.
Get a mutable handle to the value by calling ` ToOwned :: to_owned ` on the current value .
&self
apply
impl FnOnce(&mut T)
&self
apply
impl FnOnce(&mut T)
examples
None