pub struct Cell<T, Seq> { /* private fields */ }
Implementations§
source§impl<T, SequenceFactory: SequenceFactory> Cell<T, Sequence<SequenceFactory>>
impl<T, SequenceFactory: SequenceFactory> Cell<T, Sequence<SequenceFactory>>
pub fn new(ctx: &mut Context<SequenceFactory>, value: T) -> Self
pub fn set(&mut self, ctx: &mut Context<SequenceFactory>, value: T)
pub fn last_modified(&self) -> &Sequence<SequenceFactory>
sourcepub fn borrow_mut(&mut self, ctx: &mut Context<SequenceFactory>) -> &mut T
pub fn borrow_mut(&mut self, ctx: &mut Context<SequenceFactory>) -> &mut T
Mutably borrow the cell.
Note that the following lines are equivalent. The benefit of borrow_mut()
is for values that are not (cheaply) clonable.
*cell.borrow_mut(&mut ctx) += 1;
cell.set(&mut ctx, *cell.clone() + 1);
pub fn into(self) -> T
Trait Implementations§
source§impl<T: Clone, SequenceFactory: SequenceFactory> Mergable for Cell<T, Sequence<SequenceFactory>>
impl<T: Clone, SequenceFactory: SequenceFactory> Mergable for Cell<T, Sequence<SequenceFactory>>
Auto Trait Implementations§
impl<T, Seq> RefUnwindSafe for Cell<T, Seq>where Seq: RefUnwindSafe, T: RefUnwindSafe,
impl<T, Seq> Send for Cell<T, Seq>where Seq: Send, T: Send,
impl<T, Seq> Sync for Cell<T, Seq>where Seq: Sync, T: Sync,
impl<T, Seq> Unpin for Cell<T, Seq>where Seq: Unpin, T: Unpin,
impl<T, Seq> UnwindSafe for Cell<T, Seq>where Seq: UnwindSafe, T: UnwindSafe,
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