pub struct FloatGenerator<T> { /* private fields */ }Expand description
Generator for floating-point values. Created by floats().
By default, may produce NaN and infinity when no bounds are set. Setting bounds automatically disables these unless re-enabled.
Implementations§
Source§impl<T> FloatGenerator<T>
impl<T> FloatGenerator<T>
Sourcepub fn exclude_min(self, exclude_min: bool) -> Self
pub fn exclude_min(self, exclude_min: bool) -> Self
Set whether to exclude the minimum value from the range.
Sourcepub fn exclude_max(self, exclude_max: bool) -> Self
pub fn exclude_max(self, exclude_max: bool) -> Self
Set whether to exclude the maximum value from the range.
Sourcepub fn allow_nan(self, allow: bool) -> Self
pub fn allow_nan(self, allow: bool) -> Self
Whether NaN values are allowed. Cannot be used with bounds.
Sourcepub fn allow_infinity(self, allow: bool) -> Self
pub fn allow_infinity(self, allow: bool) -> Self
Whether infinite values are allowed. Cannot be used with both bounds set.
Trait Implementations§
Source§impl<T: Float + DeserializeOwned + Serialize + Send + Sync + 'static> Generator<T> for FloatGenerator<T>
impl<T: Float + DeserializeOwned + Serialize + Send + Sync + 'static> Generator<T> for FloatGenerator<T>
Source§fn map<U, F>(self, f: F) -> Mapped<T, U, F, Self>
fn map<U, F>(self, f: F) -> Mapped<T, U, F, Self>
Transform generated values using a function. Read more
Source§fn flat_map<U, G, F>(self, f: F) -> FlatMapped<T, U, G, F, Self>
fn flat_map<U, G, F>(self, f: F) -> FlatMapped<T, U, G, F, Self>
Generate a value, then use it to choose or configure another generator. Read more
Auto Trait Implementations§
impl<T> Freeze for FloatGenerator<T>where
T: Freeze,
impl<T> RefUnwindSafe for FloatGenerator<T>where
T: RefUnwindSafe,
impl<T> Send for FloatGenerator<T>where
T: Send,
impl<T> Sync for FloatGenerator<T>where
T: Sync,
impl<T> Unpin for FloatGenerator<T>where
T: Unpin,
impl<T> UnsafeUnpin for FloatGenerator<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for FloatGenerator<T>where
T: UnwindSafe,
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