pub struct NegativeInt<T>(/* private fields */)
where
T: PartialOrd + Default + Copy + Display;Expand description
A negative integer (value < 0).
Implementations§
Source§impl<T> NegativeInt<T>
impl<T> NegativeInt<T>
Sourcepub fn new(value: T) -> Result<NegativeInt<T>, String>
pub fn new(value: T) -> Result<NegativeInt<T>, String>
Create a new constrained value, returning an error if the constraint is violated.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Get the inner value.
Trait Implementations§
Source§impl<T> Clone for NegativeInt<T>
impl<T> Clone for NegativeInt<T>
Source§fn clone(&self) -> NegativeInt<T>
fn clone(&self) -> NegativeInt<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for NegativeInt<T>
impl<T> Debug for NegativeInt<T>
Source§impl<T> Deref for NegativeInt<T>
impl<T> Deref for NegativeInt<T>
Source§impl<'de, T> Deserialize<'de> for NegativeInt<T>
impl<'de, T> Deserialize<'de> for NegativeInt<T>
Source§fn deserialize<D>(
deserializer: D,
) -> Result<NegativeInt<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<NegativeInt<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> Display for NegativeInt<T>
impl<T> Display for NegativeInt<T>
Source§impl<T> Hash for NegativeInt<T>
impl<T> Hash for NegativeInt<T>
Source§impl<T> Ord for NegativeInt<T>
impl<T> Ord for NegativeInt<T>
Source§fn cmp(&self, other: &NegativeInt<T>) -> Ordering
fn cmp(&self, other: &NegativeInt<T>) -> Ordering
1.21.0 · 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<T> PartialEq for NegativeInt<T>
impl<T> PartialEq for NegativeInt<T>
Source§impl<T> PartialOrd for NegativeInt<T>
impl<T> PartialOrd for NegativeInt<T>
Source§impl<T> Serialize for NegativeInt<T>
impl<T> Serialize for NegativeInt<T>
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<T> Copy for NegativeInt<T>
impl<T> Eq for NegativeInt<T>
impl<T> StructuralPartialEq for NegativeInt<T>
Auto Trait Implementations§
impl<T> Freeze for NegativeInt<T>where
T: Freeze,
impl<T> RefUnwindSafe for NegativeInt<T>where
T: RefUnwindSafe,
impl<T> Send for NegativeInt<T>where
T: Send,
impl<T> Sync for NegativeInt<T>where
T: Sync,
impl<T> Unpin for NegativeInt<T>where
T: Unpin,
impl<T> UnsafeUnpin for NegativeInt<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for NegativeInt<T>where
T: UnwindSafe,
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,
Source§impl<T> Dump for Twhere
T: Serialize,
impl<T> Dump for Twhere
T: Serialize,
Source§fn dump_with(&self, options: &DumpOptions) -> Result<Value, Error>
fn dump_with(&self, options: &DumpOptions) -> Result<Value, Error>
Serialize to a
serde_json::Value with custom options.Source§fn dump_json_with(&self, options: &DumpOptions) -> Result<String, Error>
fn dump_json_with(&self, options: &DumpOptions) -> Result<String, Error>
Serialize to a JSON string with custom options.