Enum stens::PrimitiveType
source · pub enum PrimitiveType {
Show 26 variants
U8,
U16,
U32,
U64,
U128,
U256,
U512,
U1024,
I8,
I16,
I32,
I64,
I128,
I256,
I512,
I1024,
F16b,
F16,
F32,
F64,
F80,
F128,
F256,
F512,
AsciiChar,
UnicodeChar,
}
Variants§
U8
U16
U32
U64
U128
U256
U512
U1024
I8
I16
I32
I64
I128
I256
I512
I1024
F16b
F16
F32
F64
F80
F128
F256
F512
AsciiChar
UnicodeChar
Trait Implementations§
source§impl Clone for PrimitiveType
impl Clone for PrimitiveType
source§fn clone(&self) -> PrimitiveType
fn clone(&self) -> PrimitiveType
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 Debug for PrimitiveType
impl Debug for PrimitiveType
source§impl Display for PrimitiveType
impl Display for PrimitiveType
source§impl From<PrimitiveType> for KeyType
impl From<PrimitiveType> for KeyType
source§fn from(v: PrimitiveType) -> Self
fn from(v: PrimitiveType) -> Self
Converts to this type from the input type.
source§impl From<PrimitiveType> for TypeRef
impl From<PrimitiveType> for TypeRef
source§fn from(v: PrimitiveType) -> Self
fn from(v: PrimitiveType) -> Self
Converts to this type from the input type.
source§impl Hash for PrimitiveType
impl Hash for PrimitiveType
source§impl Ord for PrimitiveType
impl Ord for PrimitiveType
source§fn cmp(&self, other: &PrimitiveType) -> Ordering
fn cmp(&self, other: &PrimitiveType) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<PrimitiveType> for PrimitiveType
impl PartialEq<PrimitiveType> for PrimitiveType
source§fn eq(&self, other: &PrimitiveType) -> bool
fn eq(&self, other: &PrimitiveType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<PrimitiveType> for PrimitiveType
impl PartialOrd<PrimitiveType> for PrimitiveType
source§fn partial_cmp(&self, other: &PrimitiveType) -> Option<Ordering>
fn partial_cmp(&self, other: &PrimitiveType) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl StrictDecode for PrimitiveType
impl StrictDecode for PrimitiveType
source§fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
Decode with the given
std::io::Read
instance; must either
construct an instance or return implementation-specific error type.source§fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
Tries to deserialize byte array into the current type using
StrictDecode::strict_decode
. If there are some data remains in the
buffer once deserialization is completed, fails with
Error::DataNotEntirelyConsumed
. Use io::Cursor
over the buffer and
StrictDecode::strict_decode
to avoid such failures.source§fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
Reads data from file at
path
and reconstructs object from it. Fails
with Error::DataNotEntirelyConsumed
if file contains remaining
data after the object reconstruction.source§impl StrictEncode for PrimitiveType
impl StrictEncode for PrimitiveType
source§fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
Encode with the given
std::io::Write
instance; must return result
with either amount of bytes encoded – or implementation-specific
error type.source§fn strict_serialize(&self) -> Result<Vec<u8, Global>, Error>
fn strict_serialize(&self) -> Result<Vec<u8, Global>, Error>
Serializes data as a byte array using
StrictEncode::strict_encode
function