pub trait OctetsFrom<Source>: Sized {
    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

Performs the conversion.

Implementations on Foreign Types

Implementors