pub struct I128<const VAL: i128>;Expand description
Marker type for passing const VAL: i128 as a type parameter.
§Serde compatibility
When the "serde" feature is enabled,
this type is serialized/deserialized as the VAL const parameter.
ⓘ
use typewit::const_marker::I128;
assert_eq!(serde_json::from_str::<I128<1>>("1").unwrap(), I128::<1>);
// trying to deserialize `I128<1>` from any value other than `1` produces an error
assert!(serde_json::from_str::<I128<1>>("0").is_err());
assert_eq!(serde_json::to_string(&I128::<1>).unwrap(), "1");
assert_eq!(serde_json::to_string(&I128::<92>).unwrap(), "92");
Implementations§
Source§impl<const VAL: i128> I128<VAL>
impl<const VAL: i128> I128<VAL>
Sourcepub const fn eq<const OTHER: i128>(
self,
_other: I128<OTHER>,
) -> Result<TypeEq<I128<VAL>, I128<OTHER>>, TypeNe<I128<VAL>, I128<OTHER>>>
👎Deprecated since 1.8.0: superceeded by equals method
pub const fn eq<const OTHER: i128>( self, _other: I128<OTHER>, ) -> Result<TypeEq<I128<VAL>, I128<OTHER>>, TypeNe<I128<VAL>, I128<OTHER>>>
superceeded by equals method
Compares self and other for equality.
Returns:
Ok(TypeEq): ifVAL == OTHERErr(TypeNe): ifVAL != OTHER
Trait Implementations§
Source§impl<const VAL: i128> ConstMarker for I128<VAL>
impl<const VAL: i128> ConstMarker for I128<VAL>
Source§impl<const VAL: i128> Ord for I128<VAL>
impl<const VAL: i128> Ord for I128<VAL>
Source§impl<const L: i128, const R: i128> PartialOrd<I128<R>> for I128<L>
impl<const L: i128, const R: i128> PartialOrd<I128<R>> for I128<L>
impl<const VAL: i128> Copy for I128<VAL>
impl<const VAL: i128> Eq for I128<VAL>
Auto Trait Implementations§
impl<const VAL: i128> Freeze for I128<VAL>
impl<const VAL: i128> RefUnwindSafe for I128<VAL>
impl<const VAL: i128> Send for I128<VAL>
impl<const VAL: i128> Sync for I128<VAL>
impl<const VAL: i128> Unpin for I128<VAL>
impl<const VAL: i128> UnsafeUnpin for I128<VAL>
impl<const VAL: i128> UnwindSafe for I128<VAL>
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