pub trait ReadScalar: FixedSize {
    fn read(bytes: &[u8]) -> Option<Self>;
}
Expand description

A trait for types that can be read from raw bytes.

This is a generalization that gives us a failable read method for all our Scalar types, as well as their BigEndian representations.

You should not need to implement this trait; it is provided automatically when you implement Scalar.

Required Methods§

Interpret the provided bytes as Self, if they are the right length.

This should use all the provided bytes; bounds checking is performed upstream.

Implementations on Foreign Types§

Implementors§