pub enum PrimitiveValue {
U8(u8),
U16(u16),
U32(u32),
U64(u64),
I8(i8),
I16(i16),
I32(i32),
I64(i64),
F32(f32),
F64(f64),
Bool(bool),
}Expand description
An owned, dynamically typed primitive value.
Variants§
U8(u8)
An unsigned 8-bit integer.
U16(u16)
An unsigned 16-bit integer.
U32(u32)
An unsigned 32-bit integer.
U64(u64)
An unsigned 64-bit integer.
I8(i8)
A signed 8-bit integer.
I16(i16)
A signed 16-bit integer.
I32(i32)
A signed 32-bit integer.
I64(i64)
A signed 64-bit integer.
F32(f32)
A 32-bit floating-point number.
F64(f64)
A 64-bit floating-point number.
Bool(bool)
A Boolean value.
Implementations§
Source§impl PrimitiveValue
impl PrimitiveValue
Sourcepub const fn size(self) -> usize
pub const fn size(self) -> usize
Returns the complete encoded width of this primitive, in bytes.
Primitive encodings have no length prefix, so this is also the complete
serialized size under wincode’s DefaultConfig.
Trait Implementations§
Source§impl Clone for PrimitiveValue
impl Clone for PrimitiveValue
Source§fn clone(&self) -> PrimitiveValue
fn clone(&self) -> PrimitiveValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PrimitiveValue
Source§impl Debug for PrimitiveValue
impl Debug for PrimitiveValue
Source§impl PartialEq for PrimitiveValue
impl PartialEq for PrimitiveValue
Source§impl<'de, C: ConfigCore> SchemaReadContext<'de, C, PrimitiveTy> for PrimitiveValue
impl<'de, C: ConfigCore> SchemaReadContext<'de, C, PrimitiveTy> for PrimitiveValue
type Dst = PrimitiveValue
Source§fn read_with_context(
ctx: PrimitiveTy,
reader: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> ReadResult<()>
fn read_with_context( ctx: PrimitiveTy, reader: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> ReadResult<()>
impl StructuralPartialEq for PrimitiveValue
Auto Trait Implementations§
impl Freeze for PrimitiveValue
impl RefUnwindSafe for PrimitiveValue
impl Send for PrimitiveValue
impl Sync for PrimitiveValue
impl Unpin for PrimitiveValue
impl UnsafeUnpin for PrimitiveValue
impl UnwindSafe for PrimitiveValue
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