pub struct AppMsg<T>where
T: StrictEncode + StrictDecode,{
pub app: StormApp,
pub data: T,
}
Fields§
§app: StormApp
§data: T
Trait Implementations§
source§impl<T> Clone for AppMsg<T>where
T: StrictEncode + StrictDecode + Clone,
impl<T> Clone for AppMsg<T>where
T: StrictEncode + StrictDecode + Clone,
source§impl<T> Debug for AppMsg<T>where
T: StrictEncode + StrictDecode + Debug,
impl<T> Debug for AppMsg<T>where
T: StrictEncode + StrictDecode + Debug,
source§impl<T> Display for AppMsg<T>where
T: Display + StrictEncode + StrictDecode,
impl<T> Display for AppMsg<T>where
T: Display + StrictEncode + StrictDecode,
source§impl<T> Hash for AppMsg<T>where
T: StrictEncode + StrictDecode + Hash,
impl<T> Hash for AppMsg<T>where
T: StrictEncode + StrictDecode + Hash,
source§impl<T> Ord for AppMsg<T>where
T: StrictEncode + StrictDecode + Ord,
impl<T> Ord for AppMsg<T>where
T: StrictEncode + StrictDecode + Ord,
source§impl<T> PartialEq<AppMsg<T>> for AppMsg<T>where
T: StrictEncode + StrictDecode + PartialEq,
impl<T> PartialEq<AppMsg<T>> for AppMsg<T>where
T: StrictEncode + StrictDecode + PartialEq,
source§impl<T> PartialOrd<AppMsg<T>> for AppMsg<T>where
T: StrictEncode + StrictDecode + PartialOrd,
impl<T> PartialOrd<AppMsg<T>> for AppMsg<T>where
T: StrictEncode + StrictDecode + PartialOrd,
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> StormMesg for AppMsg<T>where
T: StrictEncode + StrictDecode,
impl<T> StormMesg for AppMsg<T>where
T: StrictEncode + StrictDecode,
source§impl<T> StrictDecode for AppMsg<T>where
T: StrictEncode + StrictDecode,
impl<T> StrictDecode for AppMsg<T>where
T: StrictEncode + 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 AppMsg<T>where
T: StrictEncode + StrictDecode,
impl<T> StrictEncode for AppMsg<T>where
T: StrictEncode + StrictDecode,
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