pub trait BytesRepresentable<E = GeneralError>: AsRef<[u8]> + for<'a> TryFrom<&'a [u8], Error = E> {
const SIZE: usize;
// Provided method
fn into_boxed(self) -> Box<[u8]> { ... }
}
Expand description
Represents a type that is already internally represented by a fixed size byte array, and therefore requires no memory allocation to represent the type in binary encoding.
This is a strict subset of BytesEncodable, see its documentation for details.
Required Associated Constants§
Provided Methods§
Sourcefn into_boxed(self) -> Box<[u8]>
fn into_boxed(self) -> Box<[u8]>
Convenience function to copy this type’s binary representation into a Box.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl BytesRepresentable for CurvePoint
impl BytesRepresentable for CurvePoint
Source§impl BytesRepresentable for HalfKey
impl BytesRepresentable for HalfKey
Source§impl BytesRepresentable for Hash
impl BytesRepresentable for Hash
Source§const SIZE: usize = 32usize
const SIZE: usize = 32usize
Size of the digest, which is EthDigest::SIZE
.