EncodablePrimitive

Enum EncodablePrimitive 

Source
pub enum EncodablePrimitive<'a> {
Show 15 variants U8(u8), OwnedU8(u8), U16(u16), Bool(bool), U24(U24), U256(Inner<'a, true, 32, 0, 0>), Signature(Inner<'a, true, 64, 0, 0>), U32(u32), U32AsRef(Inner<'a, true, 4, 0, 0>), F32(f32), U64(u64), B032(Inner<'a, false, 1, 1, 32>), B0255(Inner<'a, false, 1, 1, 255>), B064K(Inner<'a, false, 1, 2, binary_codec_sv2::::datatypes::non_copy_data_types::B064K::{constant#3}>), B016M(Inner<'a, false, 1, 3, binary_codec_sv2::::datatypes::non_copy_data_types::B016M::{constant#3}>),
}
Expand description

The EncodablePrimitive enum defines primitive types that can be encoded.

The enum represents various data types, such a integers, bool, and byte array that can be encoded into a byte representation. Each variant holds a specific type, and encoding logic is provided through the encode method.

Variants§

§

U8(u8)

U8 Primitive, representing a byte

§

OwnedU8(u8)

Owned U8 Primitive, representing an owned byte

§

U16(u16)

U16 Primitive, representing a u16 type

§

Bool(bool)

Bool Primitive, representing a bool type

§

U24(U24)

U24 Primitive, representing a U24 type

§

U256(Inner<'a, true, 32, 0, 0>)

U256 Primitive, representing a U256 type

§

Signature(Inner<'a, true, 64, 0, 0>)

Signature Primitive, representing a Signature type

§

U32(u32)

U32 Primitive, representing a u32 type

§

U32AsRef(Inner<'a, true, 4, 0, 0>)

U32AsRef Primitive, representing a U32AsRef type

§

F32(f32)

F32 Primitive, representing a f32 type

§

U64(u64)

U64 Primitive, representing a u64 type

§

B032(Inner<'a, false, 1, 1, 32>)

B032 Primitive, representing a B032 type

§

B0255(Inner<'a, false, 1, 1, 255>)

B0255 Primitive, representing a B0255 type

§

B064K(Inner<'a, false, 1, 2, binary_codec_sv2::::datatypes::non_copy_data_types::B064K::{constant#3}>)

B064K Primitive, representing a B064K type

§

B016M(Inner<'a, false, 1, 3, binary_codec_sv2::::datatypes::non_copy_data_types::B016M::{constant#3}>)

B016M Primitive, representing a B016M type

Trait Implementations§

Source§

impl<'a> Debug for EncodablePrimitive<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl GetSize for EncodablePrimitive<'_>

Source§

fn get_size(&self) -> usize

get_size returns total size of the type in bytes.

Auto Trait Implementations§

§

impl<'a> Freeze for EncodablePrimitive<'a>

§

impl<'a> RefUnwindSafe for EncodablePrimitive<'a>

§

impl<'a> Send for EncodablePrimitive<'a>

§

impl<'a> Sync for EncodablePrimitive<'a>

§

impl<'a> Unpin for EncodablePrimitive<'a>

§

impl<'a> !UnwindSafe for EncodablePrimitive<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.