pub struct PositiveF64(/* private fields */);Expand description
A strictly positive, finite f64 value.
Used for parameters that must be greater than zero, such as scaling ratios.
§Construction
use cugraph::params::PositiveF64;
let eps = PositiveF64::new(1e-5).unwrap();
assert_eq!(eps.get(), 1e-5);
// Zero and negative values are rejected:
assert!(PositiveF64::new(0.0).is_err());
assert!(PositiveF64::new(-1.0).is_err());
// Infinity and NaN are rejected:
assert!(PositiveF64::new(f64::INFINITY).is_err());
assert!(PositiveF64::new(f64::NAN).is_err());Implementations§
Trait Implementations§
Source§impl Clone for PositiveF64
impl Clone for PositiveF64
impl Copy for PositiveF64
Source§impl Debug for PositiveF64
impl Debug for PositiveF64
Source§impl Display for PositiveF64
impl Display for PositiveF64
Source§impl From<PositiveF64> for f64
impl From<PositiveF64> for f64
Source§fn from(val: PositiveF64) -> f64
fn from(val: PositiveF64) -> f64
Converts to this type from the input type.
Source§impl PartialEq for PositiveF64
impl PartialEq for PositiveF64
Source§impl PartialOrd for PositiveF64
impl PartialOrd for PositiveF64
impl StructuralPartialEq for PositiveF64
Auto Trait Implementations§
impl Freeze for PositiveF64
impl RefUnwindSafe for PositiveF64
impl Send for PositiveF64
impl Sync for PositiveF64
impl Unpin for PositiveF64
impl UnsafeUnpin for PositiveF64
impl UnwindSafe for PositiveF64
Blanket Implementations§
impl<T> Allocation for T
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