[go: up one dir, main page]

Fill

Trait Fill 

Source
pub trait Fill: Sized {
    // Required method
    fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R);
}
Expand description

Support filling a slice with random data

This trait allows slices of “plain data” types to be efficiently filled with random data.

Implementations are expected to be portable across machines unless clearly documented otherwise (see the Chapter on Portability). The implementations provided achieve this by byte-swapping on big-endian machines.

Required Methods§

Source

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Fill this with random data

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Fill for i8

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for i16

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for i32

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for i64

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for i128

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for u8

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for u16

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for u32

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for u64

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for u128

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for Wrapping<i8>

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for Wrapping<i16>

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for Wrapping<i32>

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for Wrapping<i64>

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for Wrapping<i128>

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for Wrapping<u16>

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for Wrapping<u32>

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for Wrapping<u64>

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Source§

impl Fill for Wrapping<u128>

Source§

fn fill_slice<R: Rng + ?Sized>(this: &mut [Self], rng: &mut R)

Implementors§