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 Magic

Source§

const SIZE: usize = 4usize

Source§

impl FromData for PlatformId

Source§

const SIZE: usize = 2usize

Source§

impl FromData for OffsetSize

Source§

const SIZE: usize = 1usize

Source§

impl FromData for LookupSegment

Source§

const SIZE: usize = 6usize

Source§

impl FromData for LookupSingle

Source§

const SIZE: usize = 4usize

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 FeatureTableSubstitutionRecord

Source§

const SIZE: usize = 6usize

Source§

impl FromData for FeatureVariationRecord

Source§

const SIZE: usize = 8usize

Source§

impl FromData for TagRecord

Source§

const SIZE: usize = 6usize

Source§

impl FromData for RangeRecord

Source§

const SIZE: usize = 6usize

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 SequenceLookupRecord

Source§

const SIZE: usize = 4usize

Source§

impl FromData for F2DOT14

Source§

const SIZE: usize = 2usize

Source§

impl FromData for Offset16

Source§

const SIZE: usize = 2usize

Source§

impl FromData for Offset24

Source§

const SIZE: usize = 3usize

Source§

impl FromData for Offset32

Source§

const SIZE: usize = 4usize

Source§

impl FromData for U24

Source§

const SIZE: usize = 3usize

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 VariationAxis

Source§

const SIZE: usize = 20usize

Source§

impl FromData for GlyphIdOffsetPair

Source§

const SIZE: usize = 4usize

Source§

impl FromData for ttf_parser::tables::cff::charset::Format1Range

Source§

const SIZE: usize = 3usize

Source§

impl FromData for Format2Range

Source§

const SIZE: usize = 4usize

Source§

impl FromData for ttf_parser::tables::cff::encoding::Format1Range

Source§

const SIZE: usize = 2usize

Source§

impl FromData for Supplement

Source§

const SIZE: usize = 3usize

Source§

impl FromData for StringId

Source§

const SIZE: usize = 2usize

Source§

impl FromData for SubHeaderRecord

Source§

const SIZE: usize = 8usize

Source§

impl FromData for SequentialMapGroup

Source§

const SIZE: usize = 12usize

Source§

impl FromData for UVSMappingRecord

Source§

const SIZE: usize = 5usize

Source§

impl FromData for UnicodeRangeRecord

Source§

const SIZE: usize = 4usize

Source§

impl FromData for VariationSelectorRecord

Source§

const SIZE: usize = 11usize

Source§

impl FromData for EncodingRecord

Source§

const SIZE: usize = 8usize

Source§

impl FromData for BaseGlyphPaintRecord

Source§

const SIZE: usize = 6usize

Source§

impl FromData for BaseGlyphRecord

Source§

const SIZE: usize = 6usize

Source§

impl FromData for ClipRecord

Source§

const SIZE: usize = 7usize

Source§

impl FromData for ColorStopRaw

Source§

const SIZE: usize = 6usize

Source§

impl FromData for LayerRecord

Source§

const SIZE: usize = 4usize

Source§

impl FromData for VarColorStopRaw

Source§

const SIZE: usize = 10usize

Source§

impl FromData for BgraColor

Source§

const SIZE: usize = 4usize

Source§

impl FromData for FeatureNameRecord

Source§

const SIZE: usize = 12usize

Source§

impl FromData for EntryExitRecord

Source§

const SIZE: usize = 4usize

Source§

impl FromData for MarkRecord

Source§

const SIZE: usize = 4usize

Source§

impl FromData for ValueFormatFlags

Source§

const SIZE: usize = 2usize

Source§

impl FromData for Control

Source§

const SIZE: usize = 1usize

Source§

impl FromData for AATCoverage

Source§

const SIZE: usize = 1usize

Source§

impl FromData for OTCoverage

Source§

const SIZE: usize = 1usize

Source§

impl FromData for KernInfoRecord

Source§

const SIZE: usize = 8usize

Source§

impl FromData for MathValueRecord

Source§

const SIZE: usize = 4usize

Source§

impl FromData for ValueRecord

Source§

const SIZE: usize = 8usize

Source§

impl FromData for NameRecord

Source§

const SIZE: usize = 12usize

Source§

impl FromData for SvgDocumentRecord

Source§

const SIZE: usize = 12usize

Source§

impl FromData for TrackTableRecord

Source§

const SIZE: usize = 8usize

Source§

impl FromData for RegionAxisCoordinatesRecord

Source§

const SIZE: usize = 6usize

Source§

impl FromData for VerticalOriginMetrics

Source§

const SIZE: usize = 4usize

Source§

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