Trait typemap_core::ContainsMut[][src]

pub trait ContainsMut<T>: TypeMapSet { }

The ContainsMut trait marks a map as containing at least one instance of a given type that can be mutated

use typemap_core::{typemap, TypeMapGet, ContainsMut};
fn modifies_u32<Opts: ContainsMut<u32>>(opts: &mut Opts) {
    opts.set::<u32>(1337);
}

let mut map = typemap!(u32 = 42u32);
modifies_u32(&mut map);
println!("{}", map.get::<u32>());

On nightly, this trait functions as intended with the help of an unstable feature. Unfortunately, it cannot be implemented as intended on stable at the moment, so it is given a blanket implementation to ensure that bounds that work on nightly do not cause errors on stable.

Implementors

impl<A: 'static, B: 'static, R: ContainsMut<B>> ContainsMut<B> for Ty<A, R>[src]

impl<A: 'static, B: 'static, R: TypeMapSet> ContainsMut<A> for &mut Ty<B, R> where
    Ty<B, R>: TypeMapSet + ContainsMut<A>, 
[src]

impl<A: 'static, R: TypeMapSet> ContainsMut<A> for Ty<A, R>[src]

Loading content...