1.0.0[][src]Trait std::borrow::BorrowMut

pub trait BorrowMut<Borrowed>: Borrow<Borrowed> where
    Borrowed: ?Sized
{ fn borrow_mut(&mut self) -> &mut Borrowed; }

A trait for mutably borrowing data.

As a companion to Borrow<T> this trait allows a type to borrow as an underlying type by providing a mutable reference. See Borrow<T> for more information on borrowing as another type.

Required Methods

Important traits for &'_ mut I

Mutably borrows from an owned value.

Examples

use std::borrow::BorrowMut;

fn check<T: BorrowMut<[i32]>>(mut v: T) {
    assert_eq!(&mut [1, 2, 3], v.borrow_mut());
}

let v = vec![1, 2, 3];

check(v);Run

Implementors

impl<'_, T> BorrowMut<T> for &'_ mut T where
    T: ?Sized
[src]

Important traits for &'_ mut I

impl<T> BorrowMut<[T]> for [T; 0]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 1]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 2]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 3]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 4]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 5]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 6]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 7]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 8]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 9]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 10]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 11]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 12]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 13]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 14]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 15]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 16]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 17]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 18]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 19]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 20]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 21]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 22]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 23]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 24]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 25]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 26]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 27]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 28]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 29]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 30]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 31]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for [T; 32]
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<[T]> for Vec<T>
[src]

Important traits for &'a [u8]

impl<T> BorrowMut<T> for Box<T> where
    T: ?Sized
[src]

Important traits for &'_ mut I

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

Important traits for &'_ mut I