#[repr(transparent)]pub struct Const<T, U>(pub T, _);Expand description
Same as RawConst<T, U> but holds U instead of T, i.e. holds the parsed value.
MyDeserialize::deserialize will error with io::ErrorKind::InvalidData
if T::try_from(_: U::Primitive) fails.
Tuple Fields§
§0: TImplementations§
Trait Implementations§
Source§impl<'de, T, U> MyDeserialize<'de> for Const<T, U>
impl<'de, T, U> MyDeserialize<'de> for Const<T, U>
Source§impl<T, U> MySerialize for Const<T, U>
impl<T, U> MySerialize for Const<T, U>
Source§impl<T: Ord, U: Ord> Ord for Const<T, U>
impl<T: Ord, U: Ord> Ord for Const<T, U>
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: PartialOrd, U: PartialOrd> PartialOrd for Const<T, U>
impl<T: PartialOrd, U: PartialOrd> PartialOrd for Const<T, U>
impl<T: Copy, U: Copy> Copy for Const<T, U>
impl<T: Eq, U: Eq> Eq for Const<T, U>
impl<T, U> StructuralPartialEq for Const<T, U>
Auto Trait Implementations§
impl<T, U> Freeze for Const<T, U>where
T: Freeze,
impl<T, U> RefUnwindSafe for Const<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for Const<T, U>
impl<T, U> Sync for Const<T, U>
impl<T, U> Unpin for Const<T, U>
impl<T, U> UnwindSafe for Const<T, U>where
T: UnwindSafe,
U: 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