ttf_parser

Trait FromData

Source
pub trait FromData: Sized {
    const SIZE: usize;

    // Required method
    fn parse(data: &[u8]) -> Option<Self>;
}
Expand description

A trait for parsing raw binary data of fixed size.

This is a low-level, internal trait that should not be used directly.

Required Associated Constants§

Source

const SIZE: usize

Object’s raw data size.

Not always the same as mem::size_of.

Required Methods§

Source

fn parse(data: &[u8]) -> Option<Self>

Parses an object from a raw data.

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 FromData for Option<Offset16>

Source§

const SIZE: usize = 2usize

Source§

fn parse(data: &[u8]) -> Option<Self>

Source§

impl FromData for Option<Offset24>

Source§

const SIZE: usize = 3usize

Source§

fn parse(data: &[u8]) -> Option<Self>

Source§

impl FromData for Option<Offset32>

Source§

const SIZE: usize = 4usize

Source§

fn parse(data: &[u8]) -> Option<Self>

Source§

impl FromData for i8

Source§

const SIZE: usize = 1usize

Source§

fn parse(data: &[u8]) -> Option<Self>

Source§

impl FromData for i16

Source§

const SIZE: usize = 2usize

Source§

fn parse(data: &[u8]) -> Option<Self>

Source§

impl FromData for i32

Source§

const SIZE: usize = 4usize

Source§

fn parse(data: &[u8]) -> Option<Self>

Source§

impl FromData for u8

Source§

const SIZE: usize = 1usize

Source§

fn parse(data: &[u8]) -> Option<Self>

Source§

impl FromData for u16

Source§

const SIZE: usize = 2usize

Source§

fn parse(data: &[u8]) -> Option<Self>

Source§

impl FromData for u32

Source§

const SIZE: usize = 4usize

Source§

fn parse(data: &[u8]) -> Option<Self>

Source§

impl FromData for u64

Source§

const SIZE: usize = 8usize

Source§

fn parse(data: &[u8]) -> Option<Self>

Source§

impl FromData for ()

Source§

const SIZE: usize = 0usize

Source§

fn parse(_: &[u8]) -> Option<Self>

Implementors§

Source§

impl FromData for CompositeMode

Source§

const SIZE: usize = 1usize

Source§

impl FromData for GradientExtend

Source§

const SIZE: usize = 1usize

Source§

impl FromData for PlatformId

Source§

const SIZE: usize = 2usize

Source§

impl FromData for Point

Source§

const SIZE: usize = 4usize

Source§

impl FromData for AxisValueMap

Source§

const SIZE: usize = 4usize

Source§

impl FromData for SettingName

Source§

const SIZE: usize = 4usize

Source§

impl FromData for VariationAxis

Source§

const SIZE: usize = 20usize

Source§

impl FromData for Metrics

Source§

const SIZE: usize = 4usize

Source§

impl FromData for KerningPair

Source§

const SIZE: usize = 6usize

Source§

impl FromData for EntryData

Source§

const SIZE: usize = 2usize

Source§

impl FromData for GlyphPart

Source§

const SIZE: usize = 10usize

Source§

impl FromData for GlyphVariant

Source§

const SIZE: usize = 4usize

Source§

impl FromData for PartFlags

Source§

const SIZE: usize = 2usize

Source§

impl FromData for ContextualEntryData

Source§

const SIZE: usize = 4usize

Source§

impl FromData for Feature

Source§

const SIZE: usize = 12usize

Source§

impl FromData for InsertionEntryData

Source§

const SIZE: usize = 4usize

Source§

impl FromData for LookupFlags

Source§

const SIZE: usize = 2usize

Source§

impl FromData for RangeRecord

Source§

const SIZE: usize = 6usize

Source§

impl FromData for SequenceLookupRecord

Source§

const SIZE: usize = 4usize

Source§

impl FromData for AxisRecord

Source§

const SIZE: usize = 8usize

Source§

impl FromData for AxisValue

Source§

const SIZE: usize = 6usize

Source§

impl FromData for AxisValueSubtableFormat1

Source§

const SIZE: usize = 10usize

Source§

impl FromData for AxisValueSubtableFormat2

Source§

const SIZE: usize = 18usize

Source§

impl FromData for AxisValueSubtableFormat3

Source§

const SIZE: usize = 14usize

Source§

impl FromData for Fixed

Source§

const SIZE: usize = 4usize

Source§

impl FromData for GlyphId

Source§

const SIZE: usize = 2usize

Source§

impl FromData for TableRecord

Source§

const SIZE: usize = 16usize

Source§

impl FromData for Tag

Source§

const SIZE: usize = 4usize

Source§

impl FromData for VerticalOriginMetrics

Source§

const SIZE: usize = 4usize

Source§

impl<T: FromData> FromData for GenericStateEntry<T>

Source§

const SIZE: usize = _