pub struct NegativeInt(/* private fields */);Expand description
Strictly negative i64 (value < 0).
Implementations§
Source§impl NegativeInt
impl NegativeInt
Sourcepub fn new(value: i64) -> Result<Self, FieldError>
pub fn new(value: i64) -> Result<Self, FieldError>
Validate value < 0 and wrap it.
Source§impl NegativeInt
impl NegativeInt
Sourcepub fn into_inner(self) -> i64
pub fn into_inner(self) -> i64
Unwrap the inner value.
Trait Implementations§
Source§impl AsRef<i64> for NegativeInt
impl AsRef<i64> for NegativeInt
Source§impl Clone for NegativeInt
impl Clone for NegativeInt
Source§fn clone(&self) -> NegativeInt
fn clone(&self) -> NegativeInt
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 NegativeInt
Source§impl Debug for NegativeInt
impl Debug for NegativeInt
Source§impl Deref for NegativeInt
impl Deref for NegativeInt
Source§impl<'de> Deserialize<'de> for NegativeInt
impl<'de> Deserialize<'de> for NegativeInt
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for NegativeInt
impl Display for NegativeInt
Source§impl Dump for NegativeInt
impl Dump for NegativeInt
Source§fn serialize_dump<S: Serializer>(
&self,
serializer: S,
opts: &DumpOptions,
) -> Result<S::Ok, S::Error>
fn serialize_dump<S: Serializer>( &self, serializer: S, opts: &DumpOptions, ) -> Result<S::Ok, S::Error>
Serialize directly when supported, preserving
dump semantics. Read moreimpl Eq for NegativeInt
Source§impl From<NegativeInt> for i64
impl From<NegativeInt> for i64
Source§fn from(value: NegativeInt) -> Self
fn from(value: NegativeInt) -> Self
Converts to this type from the input type.
Source§impl Hash for NegativeInt
impl Hash for NegativeInt
Source§impl Ord for NegativeInt
impl Ord for NegativeInt
Source§fn cmp(&self, other: &NegativeInt) -> Ordering
fn cmp(&self, other: &NegativeInt) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for NegativeInt
impl PartialEq for NegativeInt
Source§impl PartialOrd for NegativeInt
impl PartialOrd for NegativeInt
Source§impl Schema for NegativeInt
impl Schema for NegativeInt
Source§fn schema(_: &mut SchemaRegistry) -> SchemaObject
fn schema(_: &mut SchemaRegistry) -> SchemaObject
The schema definition of this type. Use
SchemaRegistry::subschema for nested types.Source§fn schema_name() -> Option<&'static str>
fn schema_name() -> Option<&'static str>
Stable component name. Named types are emitted once under
components.schemas and referenced with $ref.Source§impl Serialize for NegativeInt
impl Serialize for NegativeInt
impl StructuralPartialEq for NegativeInt
Source§impl TryFrom<i64> for NegativeInt
impl TryFrom<i64> for NegativeInt
Source§impl Validate for NegativeInt
impl Validate for NegativeInt
Source§fn prepare(input: &mut Value, ctx: &mut ValidationContext)
fn prepare(input: &mut Value, ctx: &mut ValidationContext)
Check and normalise the raw input for this type in place.
Source§fn validate(&self, _ctx: &mut ValidationContext)
fn validate(&self, _ctx: &mut ValidationContext)
Check invariants of the deserialized value.
Auto Trait Implementations§
impl Freeze for NegativeInt
impl RefUnwindSafe for NegativeInt
impl Send for NegativeInt
impl Sync for NegativeInt
impl Unpin for NegativeInt
impl UnsafeUnpin for NegativeInt
impl UnwindSafe for NegativeInt
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.