# Trait ethcore_util::standard::ops::DerefMut 1.0.0 [−] [src]

    pub trait DerefMut: Deref {
        fn deref_mut(&mut self) -> &mut Self::Target;
    }

The `DerefMut` trait is used to specify the functionality of dereferencing mutably like `*v = 1;`

`DerefMut` also enables '`Deref` coercions'.

# Examples

A struct with a single field which is modifiable via dereferencing the struct.

    use std::ops::{Deref, DerefMut};

    struct DerefMutExample<T> {
        value: T
    }

    impl<T> Deref for DerefMutExample<T> {
        type Target = T;

        fn deref(&self) -> &T {
            &self.value
        }
    }

    impl<T> DerefMut for DerefMutExample<T> {
        fn deref_mut(&mut self) -> &mut T {
            &mut self.value
        }
    }

    fn main() {
        let mut x = DerefMutExample { value: 'a' };
        *x = 'b';
        assert_eq!('b', *x);
    }

## Required Methods

### `fn deref_mut(&mut self) -> &mut Self::Target`

The method called to mutably dereference a value

## Implementors

- `impl<'a, T> DerefMut for PeekMut<'a, T> where T: Ord`
- `impl DerefMut for String`
- `impl<T> DerefMut for Vec<T>`
- `impl<A> DerefMut for SmallVec<A> where A: Array`
- `impl DerefMut for H32`
- `impl DerefMut for H64`
- `impl DerefMut for H128`
- `impl DerefMut for H160`
- `impl DerefMut for H256`
- `impl DerefMut for H264`
- `impl DerefMut for H512`
- `impl DerefMut for H520`
- `impl DerefMut for H1024`
- `impl DerefMut for H2048`
- `impl DerefMut for Lit`
- `impl<T> DerefMut for ElasticArray2<T>`
- `impl<T> DerefMut for ElasticArray4<T>`
- `impl<T> DerefMut for ElasticArray8<T>`
- `impl<T> DerefMut for ElasticArray16<T>`
- `impl<T> DerefMut for ElasticArray32<T>`
- `impl<T> DerefMut for ElasticArray36<T>`
- `impl<T> DerefMut for ElasticArray64<T>`
- `impl<T> DerefMut for ElasticArray128<T>`
- `impl<T> DerefMut for ElasticArray256<T>`
- `impl<T> DerefMut for ElasticArray512<T>`
- `impl<T> DerefMut for ElasticArray1024<T>`
- `impl<T> DerefMut for ElasticArray2048<T>`
- `impl<'a, T> DerefMut for &'a mut T where T: ?Sized`
- `impl<'b, T> DerefMut for RefMut<'b, T> where T: ?Sized`
- `impl<T> DerefMut for NoDrop<T>`
- `impl<T> DerefMut for Box<T> where T: ?Sized`
- `impl<T> DerefMut for AssertUnwindSafe<T>`
- `impl<'mutex, T> DerefMut for MutexGuard<'mutex, T> where T: ?Sized`
- `impl<'rwlock, T> DerefMut for RwLockWriteGuard<'rwlock, T> where T: ?Sized`
- `impl<'a, T> DerefMut for MutexGuard<'a, T> where T: 'a + ?Sized`
- `impl<'a, T> DerefMut for RwLockWriteGuard<'a, T> where T: 'a + ?Sized`
- `impl<T> DerefMut for GuardedTempResult<T>`
- `impl<A> DerefMut for ArrayString<A> where A: Array<Item=u8>`
- `impl<A> DerefMut for ArrayVec<A> where A: Array`
- `impl<'a> DerefMut for BytesRef<'a>`

# 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
+
  Collapse/expand all sections

## 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`)