pub trait Decodable {
// Required method
fn decode<Producer>(
producer: &mut Producer,
) -> Result<Self, DecodeError<Producer::Error>>
where Producer: BulkProducer<Item = u8>,
Self: Sized;
}Expand description
A type that can be decoded from a bytestring, ensuring that every valid encoding maps to exactly one member of Self.
Required Methods§
Sourcefn decode<Producer>(
producer: &mut Producer,
) -> Result<Self, DecodeError<Producer::Error>>
fn decode<Producer>( producer: &mut Producer, ) -> Result<Self, DecodeError<Producer::Error>>
Decode a value to a bytestring in a specific way that is best described over at willowprotocol.org.