Trait domain::base::octets::OctetsFrom
source · pub trait OctetsFrom<Source>: Sized {
// Required method
fn octets_from(source: Source) -> Result<Self, ShortBuf>;
}
Expand description
Convert a type from one octets type to another.
This trait allows creating a value of a type that is generic over an octets sequence from an identical value using a different type of octets sequence.
This is different from just From
in that the conversion may fail if the
source sequence is longer than the space available for the target type.
Required Methods§
sourcefn octets_from(source: Source) -> Result<Self, ShortBuf>
fn octets_from(source: Source) -> Result<Self, ShortBuf>
Performs the conversion.