pub struct IntDistribution { /* private fields */ }Expand description
A bounded integer distribution.
Implementations§
Source§impl IntDistribution
impl IntDistribution
Sourcepub fn linear(low: i64, high: i64) -> Result<Self, ParzenError>
pub fn linear(low: i64, high: i64) -> Result<Self, ParzenError>
Create a linear integer distribution with unit step.
Sourcepub fn log(low: i64, high: i64) -> Result<Self, ParzenError>
pub fn log(low: i64, high: i64) -> Result<Self, ParzenError>
Create a positive logarithmic integer distribution with unit step.
Sourcepub fn with_step(self, step: u64) -> Result<Self, ParzenError>
pub fn with_step(self, step: u64) -> Result<Self, ParzenError>
Set a positive linear step anchored at low.
pub const fn low(self) -> i64
pub const fn high(self) -> i64
pub const fn scale(self) -> IntScale
pub const fn step(self) -> u64
Trait Implementations§
Source§impl Clone for IntDistribution
impl Clone for IntDistribution
Source§fn clone(&self) -> IntDistribution
fn clone(&self) -> IntDistribution
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for IntDistribution
Source§impl Debug for IntDistribution
impl Debug for IntDistribution
Source§impl<'de> Deserialize<'de> for IntDistribution
impl<'de> Deserialize<'de> for IntDistribution
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for IntDistribution
Source§impl PartialEq for IntDistribution
impl PartialEq for IntDistribution
Source§impl Serialize for IntDistribution
impl Serialize for IntDistribution
impl StructuralPartialEq for IntDistribution
Auto Trait Implementations§
impl Freeze for IntDistribution
impl RefUnwindSafe for IntDistribution
impl Send for IntDistribution
impl Sync for IntDistribution
impl Unpin for IntDistribution
impl UnsafeUnpin for IntDistribution
impl UnwindSafe for IntDistribution
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.