# [−] [src] Trait rand::AsByteSliceMut

    pub trait AsByteSliceMut {
        fn as_byte_slice_mut(&mut self) -> &mut [u8];
        fn to_le(&mut self);
    }

Trait for casting types to byte slices

This is used by the [`Rng::fill`] and [`Rng::try_fill`] methods.

## Required methods

### `fn as_byte_slice_mut(&mut self) -> &mut [u8]`

Return a mutable reference to self as a byte slice

### `fn to_le(&mut self)`

Call `to_le` on each element (i.e. byte-swap on Big Endian platforms).

Loading content...

## Implementations on Foreign Types

### `impl AsByteSliceMut for [u8]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [u16]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [Wrapping<u16>]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [u32]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [Wrapping<u32>]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [u64]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [Wrapping<u64>]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [usize]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [Wrapping<usize>]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [u128]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [Wrapping<u128>]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [i8]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [Wrapping<i8>]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [i16]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [Wrapping<i16>]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [i32]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [Wrapping<i32>]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [i64]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [Wrapping<i64>]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [isize]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [Wrapping<isize>]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [i128]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl AsByteSliceMut for [Wrapping<i128>]` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 32] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 31] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 30] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 29] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 28] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 27] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 26] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 25] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 24] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 23] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 22] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 21] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 20] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 19] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 18] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 17] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 16] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 15] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 14] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 13] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 12] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 11] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 10] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 9] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 8] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 7] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 6] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 5] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 4] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 3] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 2] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 1] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 0] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 4096] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 2048] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 1024] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 512] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 256] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 128] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

### `impl<T> AsByteSliceMut for [T; 64] where
[T]: AsByteSliceMut,` [src]

#### `fn as_byte_slice_mut(&mut self) -> &mut [u8]` [src]

#### `fn to_le(&mut self)` [src]

Loading content...

## Implementors

Loading content...

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse 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`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)