pub struct BoundedI64<const MIN: i64, const MAX: i64>(/* private fields */);Expand description
Signed 64-bit integer whose value is in MIN..=MAX.
Implementations§
Source§impl<const MIN: i64, const MAX: i64> BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> BoundedI64<MIN, MAX>
Sourcepub fn new(value: i64) -> Result<Self, FieldError>
pub fn new(value: i64) -> Result<Self, FieldError>
Validate value and wrap it.
Sourcepub fn into_inner(self) -> i64
pub fn into_inner(self) -> i64
Unwrap the inner integer.
Trait Implementations§
Source§impl<const MIN: i64, const MAX: i64> Clone for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> Clone for BoundedI64<MIN, MAX>
Source§fn clone(&self) -> BoundedI64<MIN, MAX>
fn clone(&self) -> BoundedI64<MIN, MAX>
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<const MIN: i64, const MAX: i64> Copy for BoundedI64<MIN, MAX>
Source§impl<'de, const MIN: i64, const MAX: i64> Deserialize<'de> for BoundedI64<MIN, MAX>
impl<'de, const MIN: i64, const MAX: i64> Deserialize<'de> for BoundedI64<MIN, MAX>
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<const MIN: i64, const MAX: i64> Dump for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> Dump for BoundedI64<MIN, MAX>
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<const MIN: i64, const MAX: i64> Eq for BoundedI64<MIN, MAX>
Source§impl<const MIN: i64, const MAX: i64> From<BoundedI64<MIN, MAX>> for i64
impl<const MIN: i64, const MAX: i64> From<BoundedI64<MIN, MAX>> for i64
Source§fn from(value: BoundedI64<MIN, MAX>) -> Self
fn from(value: BoundedI64<MIN, MAX>) -> Self
Converts to this type from the input type.
Source§impl<const MIN: i64, const MAX: i64> Ord for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> Ord for BoundedI64<MIN, MAX>
Source§fn cmp(&self, other: &BoundedI64<MIN, MAX>) -> Ordering
fn cmp(&self, other: &BoundedI64<MIN, MAX>) -> 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<const MIN: i64, const MAX: i64> PartialOrd for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> PartialOrd for BoundedI64<MIN, MAX>
Source§impl<const MIN: i64, const MAX: i64> Schema for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> Schema for BoundedI64<MIN, MAX>
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.impl<const MIN: i64, const MAX: i64> StructuralPartialEq for BoundedI64<MIN, MAX>
Source§impl<const MIN: i64, const MAX: i64> Validate for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> Validate for BoundedI64<MIN, MAX>
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<const MIN: i64, const MAX: i64> Freeze for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> RefUnwindSafe for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> Send for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> Sync for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> Unpin for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> UnsafeUnpin for BoundedI64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> UnwindSafe for BoundedI64<MIN, MAX>
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.