pub struct OptionalTrailingBool<const DEFAULT: bool>;Available on crate feature
wincode only.Expand description
A wincode schema for a bool that may be absent from the end of the
wire payload. On write, the byte is always emitted. On read, an
exhausted reader yields DEFAULT.
Trait Implementations§
Source§impl<'de, C: ConfigCore, const DEFAULT: bool> SchemaRead<'de, C> for OptionalTrailingBool<DEFAULT>
impl<'de, C: ConfigCore, const DEFAULT: bool> SchemaRead<'de, C> for OptionalTrailingBool<DEFAULT>
Source§impl<C: ConfigCore, const DEFAULT: bool> SchemaWrite<C> for OptionalTrailingBool<DEFAULT>
impl<C: ConfigCore, const DEFAULT: bool> SchemaWrite<C> for OptionalTrailingBool<DEFAULT>
Auto Trait Implementations§
impl<const DEFAULT: bool> Freeze for OptionalTrailingBool<DEFAULT>
impl<const DEFAULT: bool> RefUnwindSafe for OptionalTrailingBool<DEFAULT>
impl<const DEFAULT: bool> Send for OptionalTrailingBool<DEFAULT>
impl<const DEFAULT: bool> Sync for OptionalTrailingBool<DEFAULT>
impl<const DEFAULT: bool> Unpin for OptionalTrailingBool<DEFAULT>
impl<const DEFAULT: bool> UnsafeUnpin for OptionalTrailingBool<DEFAULT>
impl<const DEFAULT: bool> UnwindSafe for OptionalTrailingBool<DEFAULT>
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<'de, T> Deserialize<'de> for Twhere
T: SchemaRead<'de, Configuration>,
impl<'de, T> Deserialize<'de> for Twhere
T: SchemaRead<'de, Configuration>,
Source§impl<'de, T, C> Deserialize<'de, C> for Twhere
C: Config,
T: SchemaRead<'de, C>,
impl<'de, T, C> Deserialize<'de, C> for Twhere
C: Config,
T: SchemaRead<'de, C>,
Source§impl<T, C> DeserializeOwned<C> for Twhere
C: Config,
T: SchemaReadOwned<C>,
impl<T, C> DeserializeOwned<C> for Twhere
C: Config,
T: SchemaReadOwned<C>,
Source§fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
Deserialize from the given
Reader into a new Self::Dst.Source§fn deserialize_from_into<'de>(
src: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> Result<(), ReadError>
fn deserialize_from_into<'de>( src: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> Result<(), ReadError>
Deserialize from the given
Reader into dst.Source§impl<T> DeserializeOwned for Twhere
T: SchemaReadOwned<Configuration>,
impl<T> DeserializeOwned for Twhere
T: SchemaReadOwned<Configuration>,
Source§fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
Deserialize from the given
Reader into a new Self::Dst.Source§fn deserialize_from_into<'de>(
src: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> Result<(), ReadError>
fn deserialize_from_into<'de>( src: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> Result<(), ReadError>
Deserialize from the given
Reader into dst.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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, C> Serialize<C> for T
impl<T, C> Serialize<C> for T
Source§fn serialize(src: &Self::Src, config: C) -> Result<Vec<u8>, WriteError>
fn serialize(src: &Self::Src, config: C) -> Result<Vec<u8>, WriteError>
Available on crate feature
alloc only.Serialize a serializable type into a
Vec of bytes.Source§fn serialize_into(
dst: impl Writer,
src: &Self::Src,
config: C,
) -> Result<(), WriteError>
fn serialize_into( dst: impl Writer, src: &Self::Src, config: C, ) -> Result<(), WriteError>
Serialize a serializable type into the given
Writer.Source§fn serialized_size(src: &Self::Src, config: C) -> Result<u64, WriteError>
fn serialized_size(src: &Self::Src, config: C) -> Result<u64, WriteError>
Get the size in bytes of the type when serialized.
Source§impl<T> Serialize for T
impl<T> Serialize for T
Source§fn serialize(src: &Self::Src) -> Result<Vec<u8>, WriteError>
fn serialize(src: &Self::Src) -> Result<Vec<u8>, WriteError>
Available on crate feature
alloc only.Serialize a serializable type into a
Vec of bytes.Source§fn serialize_into(dst: impl Writer, src: &Self::Src) -> Result<(), WriteError>
fn serialize_into(dst: impl Writer, src: &Self::Src) -> Result<(), WriteError>
Serialize a serializable type into the given byte buffer.
Source§fn serialized_size(src: &Self::Src) -> Result<u64, WriteError>
fn serialized_size(src: &Self::Src) -> Result<u64, WriteError>
Get the size in bytes of the type when serialized.
Source§impl<T, Target, C> TagEncoding<C> for Twhere
C: ConfigCore,
T: for<'de> SchemaRead<'de, C, Dst = Target> + SchemaWrite<C, Src = Target> + 'static,
Target: TryFrom<u32>,
u32: TryFrom<Target>,
impl<T, Target, C> TagEncoding<C> for Twhere
C: ConfigCore,
T: for<'de> SchemaRead<'de, C, Dst = Target> + SchemaWrite<C, Src = Target> + 'static,
Target: TryFrom<u32>,
u32: TryFrom<Target>,
type Target = Target
Source§fn try_from_u32(
value: u32,
) -> Result<<T as TagEncoding<C>>::Target, TagEncodingOverflow>
fn try_from_u32( value: u32, ) -> Result<<T as TagEncoding<C>>::Target, TagEncodingOverflow>
Convert a
u32 to the encoding target.Source§fn try_into_u32(
x: <T as TagEncoding<C>>::Target,
) -> Result<u32, TagEncodingOverflow>
fn try_into_u32( x: <T as TagEncoding<C>>::Target, ) -> Result<u32, TagEncodingOverflow>
Convert the encoding target to a
u32.Source§fn size_of_from_u32(value: u32) -> Result<usize, WriteError>
fn size_of_from_u32(value: u32) -> Result<usize, WriteError>
Get the size of the encoding target from the given
u32. Read more