Struct bidir_map::ByFirst [] [src]

pub struct ByFirst<'q, Q: ?Sized + 'q>(pub &'q Q);

Wrapper type for getting second keys/values with first keys/values via Index.

To assume that by-first is the "default" would be incorrect, so thus you one can wrap their indices with this and all is swell.

Examples

use bidir_map::{BidirMap, ByFirst};

let mut map = BidirMap::new();
map.insert(1, "a");
assert_eq!(map[ByFirst(&1)], "a");
assert_eq!(map[&ByFirst(&1)], "a");

Trait Implementations

impl<'q, Q: Copy + ?Sized + 'q> Copy for ByFirst<'q, Q>
[src]

impl<'q, Q: Clone + ?Sized + 'q> Clone for ByFirst<'q, Q>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'q, Q: Hash + ?Sized + 'q> Hash for ByFirst<'q, Q>
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<'q, Q: PartialEq + ?Sized + 'q> PartialEq for ByFirst<'q, Q>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<'q, Q: Eq + ?Sized + 'q> Eq for ByFirst<'q, Q>
[src]

impl<'q, Q: PartialOrd + ?Sized + 'q> PartialOrd for ByFirst<'q, Q>
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'q, Q: Ord + ?Sized + 'q> Ord for ByFirst<'q, Q>
[src]

[src]

This method returns an Ordering between self and other. Read more

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more