font_types

Trait 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);

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.

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