Trait fedimint_core::encoding::Decodable
source · pub trait Decodable: Sized {
// Required method
fn consensus_decode<R: Read>(
r: &mut R,
_modules: &ModuleDecoderRegistry
) -> Result<Self, DecodeError>;
// Provided method
fn consensus_decode_hex(
hex: &str,
modules: &ModuleDecoderRegistry
) -> Result<Self, DecodeError> { ... }
}
Expand description
Data which can be encoded in a consensus-consistent way
Required Methods§
sourcefn consensus_decode<R: Read>(
r: &mut R,
_modules: &ModuleDecoderRegistry
) -> Result<Self, DecodeError>
fn consensus_decode<R: Read>( r: &mut R, _modules: &ModuleDecoderRegistry ) -> Result<Self, DecodeError>
Decode an object with a well-defined format
Provided Methods§
sourcefn consensus_decode_hex(
hex: &str,
modules: &ModuleDecoderRegistry
) -> Result<Self, DecodeError>
fn consensus_decode_hex( hex: &str, modules: &ModuleDecoderRegistry ) -> Result<Self, DecodeError>
Decode an object from hex
Object Safety§
This trait is not object safe.