Trait bilrost::WithCanonicity
source · pub trait WithCanonicity {
type Value;
type WithoutCanonicity;
// Required methods
fn canonical(self) -> Result<Self::Value, DecodeErrorKind>;
fn canonical_with_extensions(self) -> Result<Self::Value, DecodeErrorKind>;
fn value(self) -> Self::WithoutCanonicity;
}
Expand description
Trait for values and results bearing canonicity information (represented by the Canonicity
enum).
Required Associated Types§
Required Methods§
sourcefn canonical(self) -> Result<Self::Value, DecodeErrorKind>
fn canonical(self) -> Result<Self::Value, DecodeErrorKind>
Get the value if it is fully canonical, otherwise returning an error.
sourcefn canonical_with_extensions(self) -> Result<Self::Value, DecodeErrorKind>
fn canonical_with_extensions(self) -> Result<Self::Value, DecodeErrorKind>
Get the value as long as its known fields are canonical, otherwise returning an error.
sourcefn value(self) -> Self::WithoutCanonicity
fn value(self) -> Self::WithoutCanonicity
Discards the canonicity.
If this method is always being used and canonicity information is always discarded, distinguished decoding may not be needed, and the program can be made more efficient by simply using expedient decoding mode.