Struct galvanic_assert::matchers::collection::HasKey [] [src]

pub struct HasKey<K> { /* fields omitted */ }

Matches if the map-like collection contains the given key.

The Matcher tests for this by converting the map-like data structure into a key/value pair iterator.

The alternative would be to use the Index trait though experiments showed that this would not be composable with all_of! or any_of!.

Trait Implementations

impl<'a, K, V, M> Matcher<'a, M> for HasKey<K> where
    V: PartialEq + Debug + 'a,
    K: PartialEq + Debug + 'a,
    &'a M: IntoIterator<Item = (&'a K, &'a V)> + 'a, 
[src]

[src]

Checks the passed value if it satisfies the Matcher. Read more