pub struct OutOfRangeFloatError { /* private fields */ }Expand description
Error returned when a float newtype is outside its range bounds.
Implementations§
Source§impl OutOfRangeFloatError
impl OutOfRangeFloatError
Sourcepub const fn not_comparable(actual: FloatValue) -> Self
pub const fn not_comparable(actual: FloatValue) -> Self
Creates an error for a value that cannot be compared to range bounds.
Sourcepub const fn below_lower_bound(
actual: FloatValue,
lower_bound: FloatValue,
) -> Self
pub const fn below_lower_bound( actual: FloatValue, lower_bound: FloatValue, ) -> Self
Creates an error for a value below the lower bound.
Sourcepub const fn above_upper_bound(
actual: FloatValue,
upper_bound: FloatValue,
) -> Self
pub const fn above_upper_bound( actual: FloatValue, upper_bound: FloatValue, ) -> Self
Creates an error for a value above the upper bound.
Sourcepub const fn actual(&self) -> FloatValue
pub const fn actual(&self) -> FloatValue
Returns the actual value that failed validation.
Sourcepub const fn lower_bound(&self) -> Option<FloatValue>
pub const fn lower_bound(&self) -> Option<FloatValue>
Returns the lower bound that failed.
Sourcepub const fn upper_bound(&self) -> Option<FloatValue>
pub const fn upper_bound(&self) -> Option<FloatValue>
Returns the upper bound that failed.
Sourcepub const fn violation(&self) -> FloatRangeViolation
pub const fn violation(&self) -> FloatRangeViolation
Returns why range validation failed.
Trait Implementations§
Source§impl Clone for OutOfRangeFloatError
impl Clone for OutOfRangeFloatError
Source§fn clone(&self) -> OutOfRangeFloatError
fn clone(&self) -> OutOfRangeFloatError
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 moreSource§impl Debug for OutOfRangeFloatError
impl Debug for OutOfRangeFloatError
Source§impl Display for OutOfRangeFloatError
impl Display for OutOfRangeFloatError
Source§impl Error for OutOfRangeFloatError
impl Error for OutOfRangeFloatError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for OutOfRangeFloatError
impl PartialEq for OutOfRangeFloatError
Source§fn eq(&self, other: &OutOfRangeFloatError) -> bool
fn eq(&self, other: &OutOfRangeFloatError) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Structable for OutOfRangeFloatError
Available on crate feature valuable only.
impl Structable for OutOfRangeFloatError
Available on crate feature
valuable only.Source§fn definition(&self) -> StructDef<'_>
fn definition(&self) -> StructDef<'_>
Returns the struct’s definition. Read more
Source§impl Valuable for OutOfRangeFloatError
Available on crate feature valuable only.
impl Valuable for OutOfRangeFloatError
Available on crate feature
valuable only.impl Eq for OutOfRangeFloatError
impl StructuralPartialEq for OutOfRangeFloatError
Auto Trait Implementations§
impl Freeze for OutOfRangeFloatError
impl RefUnwindSafe for OutOfRangeFloatError
impl Send for OutOfRangeFloatError
impl Sync for OutOfRangeFloatError
impl Unpin for OutOfRangeFloatError
impl UnsafeUnpin for OutOfRangeFloatError
impl UnwindSafe for OutOfRangeFloatError
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