pub enum NumericBound {
Signed(i64),
Unsigned(u64),
FloatBits(u64),
}Expand description
A numeric bound usable across every numeric representation.
SchemaType derives Eq, and an i64 mantissa cannot represent
u64::MAX, so the bound is a three-family sum. Float bounds store canonical
IEEE-754 f64 bits (NaN/inf rejected at construction, -0.0 normalized
to +0.0) so the type stays Eq; comparisons always decode the bits back to
f64 and compare numerically, never by bit order.
Variants§
Implementations§
Source§impl NumericBound
impl NumericBound
Sourcepub fn float(value: f64) -> Result<NumericBound, NumericBoundError>
pub fn float(value: f64) -> Result<NumericBound, NumericBoundError>
Construct a float bound from an f64, rejecting NaN/inf and
normalizing -0.0 to +0.0.
Trait Implementations§
Source§impl Clone for NumericBound
impl Clone for NumericBound
Source§fn clone(&self) -> NumericBound
fn clone(&self) -> NumericBound
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 NumericBound
Source§impl Debug for NumericBound
impl Debug for NumericBound
Source§impl<'de> Deserialize<'de> for NumericBound
impl<'de> Deserialize<'de> for NumericBound
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<NumericBound, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<NumericBound, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for NumericBound
Source§impl FromSchema for NumericBound
impl FromSchema for NumericBound
fn from_value(value: &SchemaValue) -> Result<NumericBound, FromSchemaError>
Source§impl IntoSchema for NumericBound
impl IntoSchema for NumericBound
fn type_id() -> TypeId
fn register_in(builder: &mut SchemaBuilder) -> SchemaType
fn to_value(&self) -> SchemaValue
Source§impl PartialEq for NumericBound
impl PartialEq for NumericBound
Source§impl Serialize for NumericBound
impl Serialize for NumericBound
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
impl StructuralPartialEq for NumericBound
Auto Trait Implementations§
impl Freeze for NumericBound
impl RefUnwindSafe for NumericBound
impl Send for NumericBound
impl Sync for NumericBound
impl Unpin for NumericBound
impl UnsafeUnpin for NumericBound
impl UnwindSafe for NumericBound
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