Trait font_types::FixedSize

source ·
pub trait FixedSize: Sized {
    const RAW_BYTE_LEN: usize;
}
Expand description

A trait for types that have a known, constant size.

Required Associated Constants§

source

const RAW_BYTE_LEN: usize

The raw size of this type, in bytes.

This is the size required to represent this type in a font file, which may differ from the size of the native type:

assert_eq!(std::mem::size_of::<u16>(), u16::RAW_BYTE_LEN);
assert_eq!(Offset24::RAW_BYTE_LEN, 3);
assert_eq!(std::mem::size_of::<Offset24>(), 4);

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Scalar> FixedSize for BigEndian<T>

source§

const RAW_BYTE_LEN: usize = T::RAW_BYTE_LEN

source§

impl<T: Scalar> FixedSize for T