Inserts the `value` specified into this set, returning either a fresh key `K` if this value hasn't been seen before or otherwise returning the previous `K` used to represent value. Note that this should only be used for component model items where the creation of `value` is not side-effectful.
(&mut self, value: V)
| 571 | /// Note that this should only be used for component model items where the |
| 572 | /// creation of `value` is not side-effectful. |
| 573 | pub fn push(&mut self, value: V) -> K |
| 574 | where |
| 575 | V: Hash + Eq + Clone, |
| 576 | { |
| 577 | *self |
| 578 | .intern_map |
| 579 | .entry(value.clone()) |
| 580 | .or_insert_with(|| self.key_map.push(value)) |
| 581 | } |
| 582 | |
| 583 | /// Returns an iterator of all the values contained within this set. |
| 584 | pub fn iter(&self) -> impl Iterator<Item = (K, &V)> { |
no test coverage detected