pub struct VersionByte<const C: u8>;
Expand description
Constant version number C
as a type.
Zero-sized type that converts to and from for the value C
via Into
,
TryFrom
, Serialize
, and Deserialize
. Used for providing a version
tag at the beginning of serialized structs.
Trait Implementations§
Source§impl<const C: u8> Clone for VersionByte<C>
impl<const C: u8> Clone for VersionByte<C>
Source§fn clone(&self) -> VersionByte<C>
fn clone(&self) -> VersionByte<C>
Returns a copy 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<const C: u8> Debug for VersionByte<C>
impl<const C: u8> Debug for VersionByte<C>
Source§impl<const C: u8> Default for VersionByte<C>
impl<const C: u8> Default for VersionByte<C>
Source§fn default() -> VersionByte<C>
fn default() -> VersionByte<C>
Returns the “default value” for a type. Read more
Source§impl<'de, const C: u8> Deserialize<'de> for VersionByte<C>
impl<'de, const C: u8> Deserialize<'de> for VersionByte<C>
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 C: u8> From<VersionByte<C>> for u8
impl<const C: u8> From<VersionByte<C>> for u8
Source§fn from(VersionByte: VersionByte<C>) -> Self
fn from(VersionByte: VersionByte<C>) -> Self
Converts to this type from the input type.
Source§impl<const C: u8> PartialEq for VersionByte<C>
impl<const C: u8> PartialEq for VersionByte<C>
Source§impl<const C: u8> Serialize for VersionByte<C>
impl<const C: u8> Serialize for VersionByte<C>
impl<const C: u8> Copy for VersionByte<C>
impl<const C: u8> Eq for VersionByte<C>
impl<const C: u8> StructuralPartialEq for VersionByte<C>
Auto Trait Implementations§
impl<const C: u8> Freeze for VersionByte<C>
impl<const C: u8> RefUnwindSafe for VersionByte<C>
impl<const C: u8> Send for VersionByte<C>
impl<const C: u8> Sync for VersionByte<C>
impl<const C: u8> Unpin for VersionByte<C>
impl<const C: u8> UnwindSafe for VersionByte<C>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> PartialDefault for Twhere
T: Default,
impl<T> PartialDefault for Twhere
T: Default,
§fn partial_default() -> T
fn partial_default() -> T
Returns a value that can be safely dropped or assigned over.