Struct Primitive

Source
pub struct Primitive(/* private fields */);

Implementations§

Source§

impl Primitive

Source

pub const U8: Primitive

Source

pub const U16: Primitive

Source

pub const U24: Primitive

Source

pub const U32: Primitive

Source

pub const U40: Primitive

Source

pub const U48: Primitive

Source

pub const U56: Primitive

Source

pub const U64: Primitive

Source

pub const U128: Primitive

Source

pub const U160: Primitive

Source

pub const U256: Primitive

Source

pub const U512: Primitive

Source

pub const U1024: Primitive

Source

pub const I8: Primitive

Source

pub const I16: Primitive

Source

pub const I24: Primitive

Source

pub const I32: Primitive

Source

pub const I40: Primitive

Source

pub const I48: Primitive

Source

pub const I56: Primitive

Source

pub const I64: Primitive

Source

pub const I128: Primitive

Source

pub const I256: Primitive

Source

pub const I512: Primitive

Source

pub const I1024: Primitive

Source

pub const N8: Primitive

Source

pub const N16: Primitive

Source

pub const N24: Primitive

Source

pub const N32: Primitive

Source

pub const N48: Primitive

Source

pub const N64: Primitive

Source

pub const N128: Primitive

Source

pub const F16: Primitive

Source

pub const F32: Primitive

Source

pub const F64: Primitive

Source

pub const F80: Primitive

Source

pub const F128: Primitive

Source

pub const F256: Primitive

Source

pub const UNIT: Primitive

Source

pub const BYTE: Primitive

Source

pub const RESERVED: Primitive

Source

pub const F16B: Primitive

Source

pub const FLOAT_RESERVED_1: Primitive

Source

pub const FLOAT_RESERVED_2: Primitive

Source

pub const FLOAT_RESERVED_3: Primitive

Source

pub const FLOAT_RESERVED_4: Primitive

Source

pub const FLOAT_RESERVED_5: Primitive

Source

pub const FLOAT_RESERVED_6: Primitive

Source

pub const FLOAT_RESERVED_7: Primitive

Source

pub const FLOAT_RESERVED_8: Primitive

Source

pub const FLOAT_RESERVED_9: Primitive

Source

pub const FLOAT_RESERVED_10: Primitive

Source

pub const FLOAT_RESERVED_11: Primitive

Source

pub const FLOAT_RESERVED_12: Primitive

Source

pub const FLOAT_RESERVED_13: Primitive

Source

pub const FLOAT_RESERVED_14: Primitive

Source

pub const FLOAT_RESERVED_15: Primitive

Source

pub const FLOAT_RESERVED_16: Primitive

Source

pub const FLOAT_RESERVED_17: Primitive

Source

pub const FLOAT_RESERVED_18: Primitive

Source

pub const FLOAT_RESERVED_19: Primitive

Source

pub const FLOAT_RESERVED_20: Primitive

Source

pub const FLOAT_RESERVED_21: Primitive

Source

pub const FLOAT_RESERVED_22: Primitive

Source

pub const FLOAT_RESERVED_23: Primitive

Source

pub const FLOAT_RESERVED_24: Primitive

Source

pub const FLOAT_RESERVED_25: Primitive

Source

pub const FLOAT_RESERVED_26: Primitive

Source

pub const FLOAT_RESERVED_27: Primitive

Source

pub const FLOAT_RESERVED_28: Primitive

Source

pub const FLOAT_RESERVED_29: Primitive

Source

pub const FLOAT_RESERVED_30: Primitive

Source

pub const FLOAT_RESERVED_31: Primitive

Source

pub const FLOAT_RESERVED_32: Primitive

Source

pub const FLOAT_RESERVED_33: Primitive

Source

pub const FLOAT_RESERVED_34: Primitive

Source

pub const FLOAT_RESERVED_35: Primitive

Source

pub const FLOAT_RESERVED_36: Primitive

Source

pub const FLOAT_RESERVED_37: Primitive

Source

pub const FLOAT_RESERVED_38: Primitive

Source

pub const FLOAT_RESERVED_39: Primitive

Source

pub const FLOAT_RESERVED_40: Primitive

Source

pub const FLOAT_RESERVED_41: Primitive

Source

pub const FLOAT_RESERVED_42: Primitive

Source

pub const FLOAT_RESERVED_43: Primitive

Source

pub const FLOAT_RESERVED_44: Primitive

Source

pub const FLOAT_RESERVED_45: Primitive

Source

pub const FLOAT_RESERVED_46: Primitive

Source

pub const FLOAT_RESERVED_47: Primitive

Source

pub const FLOAT_RESERVED_48: Primitive

Source

pub const FLOAT_RESERVED_49: Primitive

Source

pub const FLOAT_RESERVED_50: Primitive

Source

pub const FLOAT_RESERVED_51: Primitive

Source

pub const FLOAT_RESERVED_52: Primitive

Source

pub const FLOAT_RESERVED_53: Primitive

Source

pub const FLOAT_RESERVED_54: Primitive

Source

pub const fn unsigned(bytes: u16) -> Self

Source

pub const fn signed(bytes: u16) -> Self

Source

pub const fn non_zero(bytes: u16) -> Self

Source

pub const fn float(bytes: u16) -> Self

Source

pub const fn from_code(code: u8) -> Self

Source

pub const fn into_code(self) -> u8

Source

pub const fn info(self) -> NumInfo

Source

pub const fn byte_size(self) -> u16

Trait Implementations§

Source§

impl AsRef<u8> for Primitive

Source§

fn as_ref(&self) -> &u8

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<u8> for Primitive

Source§

fn borrow(&self) -> &u8

Immutably borrows from an owned value. Read more
Source§

impl Clone for Primitive

Source§

fn clone(&self) -> Primitive

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Primitive

Source§

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

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

impl<'de> Deserialize<'de> for Primitive

Source§

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 Display for Primitive

Source§

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

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

impl From<Primitive> for u8

Source§

fn from(wrapped: Primitive) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Primitive

Source§

fn from(v: u8) -> Self

Converts to this type from the input type.
Source§

impl Hash for Primitive

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Primitive

Source§

fn cmp(&self, other: &Primitive) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Primitive

Source§

fn eq(&self, other: &Primitive) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Primitive

Source§

fn partial_cmp(&self, other: &Primitive) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for Primitive

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StrictDecode for Primitive

Source§

fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>

Source§

fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>

Source§

impl StrictDumb for Primitive

Source§

fn strict_dumb() -> Self

Source§

impl StrictEncode for Primitive

Source§

fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>

Source§

fn strict_write(&self, writer: impl WriteRaw) -> Result<()>

Source§

impl StrictTuple for Primitive

Source§

impl StrictType for Primitive

Source§

const STRICT_LIB_NAME: &'static str = STRICT_TYPES_LIB

Source§

fn strict_name() -> Option<TypeName>

Source§

impl Wrapper for Primitive

Source§

type Inner = u8

Inner type wrapped by the current newtype
Source§

fn from_inner(inner: Self::Inner) -> Self

Instantiates wrapper type with the inner data
Source§

fn as_inner(&self) -> &Self::Inner

Returns reference to the inner representation for the wrapper type
Source§

fn into_inner(self) -> Self::Inner

Unwraps the wrapper returning the inner type
Source§

fn to_inner(&self) -> Self::Inner
where Self::Inner: Clone,

Clones inner data of the wrapped type and return them
Source§

fn copy(&self) -> Self
where Self: Sized, Self::Inner: Copy,

Copies the wrapped type
Source§

impl Copy for Primitive

Source§

impl Eq for Primitive

Source§

impl StrictProduct for Primitive

Source§

impl StructuralPartialEq for Primitive

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,