pub trait ScorexSerializable: Sized {
    // Required methods
    fn scorex_serialize<W: WriteSigmaVlqExt>(
        &self,
        w: &mut W
    ) -> ScorexSerializeResult;
    fn scorex_parse<R: ReadSigmaVlqExt>(
        r: &mut R
    ) -> Result<Self, ScorexParsingError>;

    // Provided methods
    fn scorex_serialize_bytes(
        &self
    ) -> Result<Vec<u8>, ScorexSerializationError> { ... }
    fn scorex_parse_bytes(bytes: &[u8]) -> Result<Self, ScorexParsingError> { ... }
}
Expand description

Scorex Serializable Trait.

Required Methods§

source

fn scorex_serialize<W: WriteSigmaVlqExt>( &self, w: &mut W ) -> ScorexSerializeResult

Write self to the writer

source

fn scorex_parse<R: ReadSigmaVlqExt>( r: &mut R ) -> Result<Self, ScorexParsingError>

parse self from reader

Provided Methods§

source

fn scorex_serialize_bytes(&self) -> Result<Vec<u8>, ScorexSerializationError>

Serialize a ScorexSerializable value into bytes

source

fn scorex_parse_bytes(bytes: &[u8]) -> Result<Self, ScorexParsingError>

Parse self from the bytes

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ScorexSerializable for u32

Corresponds to VLQ(UInt) format from ErgoTree spec.

source§

impl<T: ScorexSerializable> ScorexSerializable for Option<Box<T>>

source§

impl<T: ScorexSerializable> ScorexSerializable for Vec<T>

source§

impl<T: ScorexSerializable, const L: usize, const U: usize> ScorexSerializable for BoundedVec<T, L, U>

Implementors§