pub trait StemCellBehavior<T> {
    fn new(t: T) -> Self
    where
        Self: Sized
; fn map_ref<F, R>(&self, f: F) -> R
    where
        F: for<'a> FnMut(&'a T) -> R
; fn map_mut<F, R>(&self, f: F) -> R
    where
        F: for<'a> FnMut(&'a mut T) -> R
; }
Expand description

A mutable memory location

This is used to back the behavior of Stem, which should be used instead of this trait.

Required Methods§

source

fn new(t: T) -> Selfwhere
    Self: Sized,

Create an instance of Self

source

fn map_ref<F, R>(&self, f: F) -> Rwhere
    F: for<'a> FnMut(&'a T) -> R,

Map a reference to T to a new type

Implementors may choose to panic or block if map_mut called concurrently.

source

fn map_mut<F, R>(&self, f: F) -> Rwhere
    F: for<'a> FnMut(&'a mut T) -> R,

Map a mutable reference to T to a new type

Implementors may choose to panic or block if map_ref or map_mut called concurrently.

Implementations on Foreign Types§

source§

impl<T> StemCellBehavior<T> for RwLock<T>

source§

fn new(t: T) -> Self

source§

fn map_ref<F, R>(&self, f: F) -> Rwhere
    F: for<'a> FnMut(&'a T) -> R,

source§

fn map_mut<F, R>(&self, f: F) -> Rwhere
    F: for<'a> FnMut(&'a mut T) -> R,

source§

impl<T> StemCellBehavior<T> for RefCell<T>

source§

fn new(t: T) -> Self

source§

fn map_ref<F, R>(&self, f: F) -> Rwhere
    F: for<'a> FnMut(&'a T) -> R,

source§

fn map_mut<F, R>(&self, f: F) -> Rwhere
    F: for<'a> FnMut(&'a mut T) -> R,

Implementors§