Trait elrond_codec::TopEncode[][src]

pub trait TopEncode: Sized {
    fn top_encode<O: TopEncodeOutput>(
        &self,
        output: O
    ) -> Result<(), EncodeError>; fn top_encode_or_exit<O: TopEncodeOutput, ExitCtx: Clone>(
        &self,
        output: O,
        c: ExitCtx,
        exit: fn(_: ExitCtx, _: EncodeError) -> !
    ) { ... } }

Required methods

Attempt to serialize the value to ouput.

Provided methods

Version of top_decode that exits quickly in case of error. Its purpose is to create smaller bytecode implementations in cases where the application is supposed to exit directly on decode error.

Implementations on Foreign Types

Allow None to be serialized to empty bytes, but leave the leading “1” for Some, to allow disambiguation between e.g. Some(0) and None.

Allow None to be serialized to empty bytes, but leave the leading “1” for Some, to allow disambiguation between e.g. Some(0) and None.

Implementors