[][src]Trait ergo_lib::serialization::serializable::SigmaSerializable

pub trait SigmaSerializable: Sized {
    fn sigma_serialize<W: SigmaByteWrite>(&self, w: &mut W) -> Result<(), Error>;
fn sigma_parse<R: SigmaByteRead>(
        r: &mut R
    ) -> Result<Self, SerializationError>; fn sigma_serialize_bytes(&self) -> Vec<u8> { ... }
fn sigma_parse_bytes(bytes: Vec<u8>) -> Result<Self, SerializationError> { ... } }

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

Loading content...

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

Loading content...

Implementors

impl SigmaSerializable for Expr[src]

impl SigmaSerializable for ProofBytes[src]

impl SigmaSerializable for SigmaBoolean[src]

impl SigmaSerializable for Constant[src]

impl SigmaSerializable for ConstantPlaceholder[src]

impl SigmaSerializable for ContextExtension[src]

impl SigmaSerializable for DataInput[src]

impl SigmaSerializable for BoxId[src]

impl SigmaSerializable for BoxValue[src]

impl SigmaSerializable for ErgoBox[src]

impl SigmaSerializable for ErgoBoxCandidate[src]

impl SigmaSerializable for Input[src]

impl SigmaSerializable for ProverResult[src]

impl SigmaSerializable for Digest32[src]

impl SigmaSerializable for TokenId[src]

impl SigmaSerializable for Transaction[src]

impl SigmaSerializable for TxId[src]

impl SigmaSerializable for OpCode[src]

impl SigmaSerializable for TypeCode[src]

impl SigmaSerializable for EcPoint[src]

impl SigmaSerializable for ProveDlog[src]

impl SigmaSerializable for ErgoTree[src]

Loading content...