Trait fmap::FunctorMut

source ·
pub trait FunctorMut<'a, A>where
    Self: FunctorSelf<'a, A>,
    A: 'a,{
    // Required method
    fn fmap_mut<F>(&mut self, f: F)
       where F: 'a + Send + FnMut(&mut Self::Inner);
}
Expand description

Same as Functor but works on &mut self

This trait is not automatically implemented. If a type doesn’t implement it but implements Functor, you can always use the Functor::fmap_fn_mutref method, which has a default implementation.

Examples

fn double_inner_i32_in_place<'a, T>(outer: &mut T)
where
    T: FunctorMut<'a, i32>,
{
    outer.fmap_mut(|x| *x *= 2);
}

Required Methods§

source

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

Same as Functor::fmap_fn_mutref but works on &mut self

Implementations on Foreign Types§

source§

impl<'a, A> FunctorMut<'a, A> for Box<dyn Iterator<Item = A> + Send + 'a>where A: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, K, A> FunctorMut<'a, A> for BTreeMap<K, A>where K: Ord, A: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A> FunctorMut<'a, A> for Box<dyn Send + FnMut() -> A + 'a>where A: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A> FunctorMut<'a, A> for Box<dyn FnOnce() -> A + 'a>where A: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A, X> FunctorMut<'a, A> for Box<dyn FnMut(X) -> A + 'a>where A: 'a, X: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A> FunctorMut<'a, A> for LinkedList<A>where A: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A> FunctorMut<'a, A> for Box<dyn Send + FnOnce() -> A + 'a>where A: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A, X> FunctorMut<'a, A> for Box<dyn Send + FnOnce(X) -> A + 'a>where A: 'a, X: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A> FunctorMut<'a, A> for Vec<A>where A: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A, X> FunctorMut<'a, A> for Box<dyn Send + FnMut(X) -> A + 'a>where A: 'a, X: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A, E> FunctorMut<'a, A> for Result<A, E>where A: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A> FunctorMut<'a, A> for Pin<Box<dyn Future<Output = A> + 'a>>where A: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A> FunctorMut<'a, A> for HashSet<A>where A: 'a + Eq + Hash,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A> FunctorMut<'a, A> for VecDeque<A>where A: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, K, A> FunctorMut<'a, A> for HashMap<K, A>where K: Eq + Hash, A: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A> FunctorMut<'a, A> for BTreeSet<A>where A: 'a + Ord,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A> FunctorMut<'a, A> for Box<dyn Iterator<Item = A> + 'a>where A: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A> FunctorMut<'a, A> for Pin<Box<dyn Future<Output = A> + Send + 'a>>where A: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A> FunctorMut<'a, A> for BinaryHeap<A>where A: 'a + Ord,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A, X> FunctorMut<'a, A> for Box<dyn FnOnce(X) -> A + 'a>where A: 'a, X: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A> FunctorMut<'a, A> for Box<dyn FnMut() -> A + 'a>where A: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

source§

impl<'a, A> FunctorMut<'a, A> for Option<A>where A: 'a,

source§

fn fmap_mut<F>(&mut self, f: F)where F: 'a + Send + FnMut(&mut Self::Inner),

Implementors§