Struct Map

pub struct Map<D, F, T, S> { /* private fields */ }

A Distribution which maps sampled values to type S

This struct is created by the Distribution::map method. See its documentation for more.

Trait Implementations

impl<D, F, T, S> Distribution<S> for Map<D, F, T, S> where D: Distribution<T>, F: Fn(T) -> S,

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> S

impl<D: Debug, F: Debug, T: Debug, S: Debug> Debug for Map<D, F, T, S>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl<D, F, T, S> Freeze for Map<D, F, T, S> where D: Freeze, F: Freeze, PhantomData<fn(T) -> S>: Freeze,

impl<D, F, T, S> RefUnwindSafe for Map<D, F, T, S> where D: RefUnwindSafe, F: RefUnwindSafe, PhantomData<fn(T) -> S>: RefUnwindSafe,

impl<D, F, T, S> Send for Map<D, F, T, S> where D: Send, F: Send, PhantomData<fn(T) -> S>: Send,

impl<D, F, T, S> Sync for Map<D, F, T, S> where D: Sync, F: Sync, PhantomData<fn(T) -> S>: Sync,

impl<D, F, T, S> Unpin for Map<D, F, T, S> where D: Unpin, F: Unpin, PhantomData<fn(T) -> S>: Unpin,

impl<D, F, T, S> UnsafeUnpin for Map<D, F, T, S> where D: UnsafeUnpin, F: UnsafeUnpin, PhantomData<fn(T) -> S>: UnsafeUnpin,

impl<D, F, T, S> UnwindSafe for Map<D, F, T, S> where D: UnwindSafe, F: UnwindSafe, PhantomData<fn(T) -> S>: UnwindSafe,

Blanket Implementations

impl<T> Any for Map<D, F, T, S> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Map<D, F, T, S> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Map<D, F, T, S> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for Map<D, F, T, S>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for Map<D, F, T, S> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Map<D, F, T, S> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Map<D, F, T, S> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>