pub struct NonNegativeInt(/* private fields */);Expand description
Non-negative i64 (value >= 0).
Implementations§
Source§impl NonNegativeInt
impl NonNegativeInt
Sourcepub fn new(value: i64) -> Result<Self, FieldError>
pub fn new(value: i64) -> Result<Self, FieldError>
Validate value >= 0 and wrap it.
Source§impl NonNegativeInt
impl NonNegativeInt
Sourcepub fn into_inner(self) -> i64
pub fn into_inner(self) -> i64
Unwrap the inner value.
Trait Implementations§
Source§impl AsRef<i64> for NonNegativeInt
impl AsRef<i64> for NonNegativeInt
Source§impl Clone for NonNegativeInt
impl Clone for NonNegativeInt
Source§fn clone(&self) -> NonNegativeInt
fn clone(&self) -> NonNegativeInt
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 NonNegativeInt
Source§impl Debug for NonNegativeInt
impl Debug for NonNegativeInt
Source§impl Deref for NonNegativeInt
impl Deref for NonNegativeInt
Source§impl<'de> Deserialize<'de> for NonNegativeInt
impl<'de> Deserialize<'de> for NonNegativeInt
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 NonNegativeInt
impl Display for NonNegativeInt
Source§impl Dump for NonNegativeInt
impl Dump for NonNegativeInt
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 NonNegativeInt
Source§impl From<NonNegativeInt> for i64
impl From<NonNegativeInt> for i64
Source§fn from(value: NonNegativeInt) -> Self
fn from(value: NonNegativeInt) -> Self
Converts to this type from the input type.
Source§impl Hash for NonNegativeInt
impl Hash for NonNegativeInt
Source§impl Ord for NonNegativeInt
impl Ord for NonNegativeInt
Source§fn cmp(&self, other: &NonNegativeInt) -> Ordering
fn cmp(&self, other: &NonNegativeInt) -> 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 NonNegativeInt
impl PartialEq for NonNegativeInt
Source§impl PartialOrd for NonNegativeInt
impl PartialOrd for NonNegativeInt
Source§impl Schema for NonNegativeInt
impl Schema for NonNegativeInt
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 NonNegativeInt
impl Serialize for NonNegativeInt
impl StructuralPartialEq for NonNegativeInt
Source§impl TryFrom<i64> for NonNegativeInt
impl TryFrom<i64> for NonNegativeInt
Source§impl Validate for NonNegativeInt
impl Validate for NonNegativeInt
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 NonNegativeInt
impl RefUnwindSafe for NonNegativeInt
impl Send for NonNegativeInt
impl Sync for NonNegativeInt
impl Unpin for NonNegativeInt
impl UnsafeUnpin for NonNegativeInt
impl UnwindSafe for NonNegativeInt
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.