Enum stens::TypeConstr
source · pub enum TypeConstr<T>where
T: Clone + Ord + Eq + Hash + Debug,{
Plain(T),
Array(u16, T),
List(T),
Set(T),
Map(KeyType, T),
}
Variants§
Implementations§
Trait Implementations§
source§impl<T> Clone for TypeConstr<T>where
T: Clone + Ord + Eq + Hash + Debug + Clone,
impl<T> Clone for TypeConstr<T>where
T: Clone + Ord + Eq + Hash + Debug + Clone,
source§fn clone(&self) -> TypeConstr<T>
fn clone(&self) -> TypeConstr<T>
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 From<TypeConstr<AsciiString<1, 32>>> for TypeRef
impl From<TypeConstr<AsciiString<1, 32>>> for TypeRef
source§fn from(v: TypeConstr<TypeName>) -> Self
fn from(v: TypeConstr<TypeName>) -> Self
Converts to this type from the input type.
source§impl From<TypeConstr<PrimitiveType>> for TypeRef
impl From<TypeConstr<PrimitiveType>> for TypeRef
source§fn from(v: TypeConstr<PrimitiveType>) -> Self
fn from(v: TypeConstr<PrimitiveType>) -> Self
Converts to this type from the input type.
source§impl<T> Ord for TypeConstr<T>where
T: Clone + Ord + Eq + Hash + Debug + Ord,
impl<T> Ord for TypeConstr<T>where
T: Clone + Ord + Eq + Hash + Debug + Ord,
source§fn cmp(&self, other: &TypeConstr<T>) -> Ordering
fn cmp(&self, other: &TypeConstr<T>) -> 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<T> PartialEq<TypeConstr<T>> for TypeConstr<T>where
T: Clone + Ord + Eq + Hash + Debug + PartialEq,
impl<T> PartialEq<TypeConstr<T>> for TypeConstr<T>where
T: Clone + Ord + Eq + Hash + Debug + PartialEq,
source§fn eq(&self, other: &TypeConstr<T>) -> bool
fn eq(&self, other: &TypeConstr<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T> PartialOrd<TypeConstr<T>> for TypeConstr<T>where
T: Clone + Ord + Eq + Hash + Debug + PartialOrd,
impl<T> PartialOrd<TypeConstr<T>> for TypeConstr<T>where
T: Clone + Ord + Eq + Hash + Debug + PartialOrd,
source§fn partial_cmp(&self, other: &TypeConstr<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &TypeConstr<T>) -> 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<T> StrictDecode for TypeConstr<T>where
T: Clone + Ord + Eq + Hash + Debug + StrictDecode,
impl<T> StrictDecode for TypeConstr<T>where
T: Clone + Ord + Eq + Hash + Debug + StrictDecode,
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<T> StrictEncode for TypeConstr<T>where
T: Clone + Ord + Eq + Hash + Debug + StrictEncode,
impl<T> StrictEncode for TypeConstr<T>where
T: Clone + Ord + Eq + Hash + Debug + StrictEncode,
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