# Struct rand_distr::uniform::UniformDuration

source · `pub struct UniformDuration { /* private fields */ }`

## Expand description

The back-end implementing `UniformSampler`

for `Duration`

.

Unless you are implementing `UniformSampler`

for your own types, this type
should not be used directly, use `Uniform`

instead.

## Trait Implementations§

source§### impl Clone for UniformDuration

### impl Clone for UniformDuration

source§#### fn clone(&self) -> UniformDuration

#### fn clone(&self) -> UniformDuration

Returns a copy of the value. Read more

1.0.0 · source§#### fn clone_from(&mut self, source: &Self)

#### fn clone_from(&mut self, source: &Self)

Performs copy-assignment from

`source`

. Read moresource§### impl Debug for UniformDuration

### impl Debug for UniformDuration

source§### impl<'de> Deserialize<'de> for UniformDuration

### impl<'de> Deserialize<'de> for UniformDuration

source§#### fn deserialize<__D>(
__deserializer: __D
) -> Result<UniformDuration, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,

#### fn deserialize<__D>( __deserializer: __D ) -> Result<UniformDuration, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

source§### impl PartialEq<UniformDuration> for UniformDuration

### impl PartialEq<UniformDuration> for UniformDuration

source§#### fn eq(&self, other: &UniformDuration) -> bool

#### fn eq(&self, other: &UniformDuration) -> bool

This method tests for

`self`

and `other`

values to be equal, and is used
by `==`

.source§### impl Serialize for UniformDuration

### impl Serialize for UniformDuration

source§#### fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,

#### fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

source§### impl UniformSampler for UniformDuration

### impl UniformSampler for UniformDuration

source§#### fn new<B1, B2>(low_b: B1, high_b: B2) -> Result<UniformDuration, Error>where
B1: SampleBorrow<<UniformDuration as UniformSampler>::X>,
B2: SampleBorrow<<UniformDuration as UniformSampler>::X>,

#### fn new<B1, B2>(low_b: B1, high_b: B2) -> Result<UniformDuration, Error>where B1: SampleBorrow<<UniformDuration as UniformSampler>::X>, B2: SampleBorrow<<UniformDuration as UniformSampler>::X>,

Construct self, with inclusive lower bound and exclusive upper bound

`[low, high)`

. Read moresource§#### fn new_inclusive<B1, B2>(
low_b: B1,
high_b: B2
) -> Result<UniformDuration, Error>where
B1: SampleBorrow<<UniformDuration as UniformSampler>::X>,
B2: SampleBorrow<<UniformDuration as UniformSampler>::X>,

#### fn new_inclusive<B1, B2>( low_b: B1, high_b: B2 ) -> Result<UniformDuration, Error>where B1: SampleBorrow<<UniformDuration as UniformSampler>::X>, B2: SampleBorrow<<UniformDuration as UniformSampler>::X>,

Construct self, with inclusive bounds

`[low, high]`

. Read moresource§#### fn sample_single<R, B1, B2>(
low: B1,
high: B2,
rng: &mut R
) -> Result<Self::X, Error>where
R: Rng + ?Sized,
B1: SampleBorrow<Self::X>,
B2: SampleBorrow<Self::X>,

#### fn sample_single<R, B1, B2>( low: B1, high: B2, rng: &mut R ) -> Result<Self::X, Error>where R: Rng + ?Sized, B1: SampleBorrow<Self::X>, B2: SampleBorrow<Self::X>,

Sample a single value uniformly from a range with inclusive lower bound
and exclusive upper bound

`[low, high)`

. Read moresource§#### fn sample_single_inclusive<R, B1, B2>(
low: B1,
high: B2,
rng: &mut R
) -> Result<Self::X, Error>where
R: Rng + ?Sized,
B1: SampleBorrow<Self::X>,
B2: SampleBorrow<Self::X>,

#### fn sample_single_inclusive<R, B1, B2>( low: B1, high: B2, rng: &mut R ) -> Result<Self::X, Error>where R: Rng + ?Sized, B1: SampleBorrow<Self::X>, B2: SampleBorrow<Self::X>,

Sample a single value uniformly from a range with inclusive lower bound
and inclusive upper bound

`[low, high]`

. Read more### impl Copy for UniformDuration

### impl Eq for UniformDuration

### impl StructuralEq for UniformDuration

### impl StructuralPartialEq for UniformDuration

## Auto Trait Implementations§

### impl RefUnwindSafe for UniformDuration

### impl Send for UniformDuration

### impl Sync for UniformDuration

### impl Unpin for UniformDuration

### impl UnwindSafe for UniformDuration

## Blanket Implementations§

source§### impl<T> BorrowMut<T> for Twhere
T: ?Sized,

### impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§#### fn borrow_mut(&mut self) -> &mut T

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

Mutably borrows from an owned value. Read more