Enum compose_spec::Number
source · pub enum Number {
UnsignedInt(u64),
SignedInt(i64),
Float(f64),
}Expand description
A numerical Value.
Variants§
UnsignedInt(u64)
A u64 (unsigned integer) value.
Positive integers will parse/deserialize into this.
SignedInt(i64)
A i64 (signed integer) value.
Negative integers will parse/deserialize into this.
Float(f64)
A f64 (floating point) value.
Implementations§
source§impl Number
impl Number
sourcepub const fn is_unsigned_int(&self) -> bool
pub const fn is_unsigned_int(&self) -> bool
Returns true if the number is an UnsignedInt.
sourcepub const fn as_unsigned_int(&self) -> Option<u64>
pub const fn as_unsigned_int(&self) -> Option<u64>
Returns Some if the number is an UnsignedInt.
sourcepub const fn is_signed_int(&self) -> bool
pub const fn is_signed_int(&self) -> bool
Returns true if the number is a SignedInt.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Number
impl<'de> Deserialize<'de> for Number
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
source§impl From<Number> for StringOrNumber
impl From<Number> for StringOrNumber
source§impl PartialEq for Number
impl PartialEq for Number
source§impl TryFrom<StringOrNumber> for Number
impl TryFrom<StringOrNumber> for Number
§type Error = ParseNumberError
type Error = ParseNumberError
The type returned in the event of a conversion error.
impl Copy for Number
impl StructuralPartialEq for Number
Auto Trait Implementations§
impl Freeze for Number
impl RefUnwindSafe for Number
impl Send for Number
impl Sync for Number
impl Unpin for Number
impl UnwindSafe for Number
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