# Struct std::collections::hash_map::OccupiedEntry [−] [src]

    pub struct OccupiedEntry<'a, K: 'a, V: 'a> {
        // some fields omitted
    }

1.0.0

A view into a single occupied location in a HashMap.

## Methods

### `impl<'a, K, V> OccupiedEntry<'a, K, V>`

#### `fn key(&self) -> &K`

Unstable (`map_entry_keys` #32281)

Gets a reference to the key in the entry.

#### `fn get(&self) -> &V`

Gets a reference to the value in the entry.

#### `fn get_mut(&mut self) -> &mut V`

Gets a mutable reference to the value in the entry.

#### `fn into_mut(self) -> &'a mut V`

Converts the OccupiedEntry into a mutable reference to the value in the entry with a lifetime bound to the map itself

#### `fn insert(&mut self, value: V) -> V`

Sets the value of the entry, and returns the entry's old value

#### `fn remove(self) -> V`

Takes the value out of the entry, and returns it

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)