Trait sigma_ser::ScorexSerializable
source · 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§
sourcefn scorex_serialize<W: WriteSigmaVlqExt>(
&self,
w: &mut W
) -> ScorexSerializeResult
fn scorex_serialize<W: WriteSigmaVlqExt>( &self, w: &mut W ) -> ScorexSerializeResult
Write self
to the writer
sourcefn scorex_parse<R: ReadSigmaVlqExt>(
r: &mut R
) -> Result<Self, ScorexParsingError>
fn scorex_parse<R: ReadSigmaVlqExt>( r: &mut R ) -> Result<Self, ScorexParsingError>
parse self
from reader
Provided Methods§
sourcefn scorex_serialize_bytes(&self) -> Result<Vec<u8>, ScorexSerializationError>
fn scorex_serialize_bytes(&self) -> Result<Vec<u8>, ScorexSerializationError>
Serialize a ScorexSerializable value into bytes
sourcefn scorex_parse_bytes(bytes: &[u8]) -> Result<Self, ScorexParsingError>
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
impl ScorexSerializable for u32
Corresponds to VLQ(UInt)
format from ErgoTree
spec.