[−][src]Trait ergo_lib::serialization::serializable::SigmaSerializable
Consensus-critical serialization for Ergo
Required methods
fn sigma_serialize<W: SigmaByteWrite>(&self, w: &mut W) -> Result<(), Error>
Write self
to the given writer
.
This function has a sigma_
prefix to alert the reader that the
serialization in use is consensus-critical serialization
Notice that the error type is std::io::Error
; this indicates that
serialization MUST be infallible up to errors in the underlying writer.
In other words, any type implementing SigmaSerializable
must make illegal states unrepresentable.
fn sigma_parse<R: SigmaByteRead>(r: &mut R) -> Result<Self, SerializationError>
Try to read self
from the given reader
.
sigma-
prefix to alert the reader that the serialization in use
is consensus-critical
Provided methods
fn sigma_serialize_bytes(&self) -> Vec<u8>
Serialize any SigmaSerializable value into bytes
fn sigma_parse_bytes(bytes: Vec<u8>) -> Result<Self, SerializationError>
Parse self
from the bytes