FromData

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 = Offset16::SIZE

Source§

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

Source§

impl FromData for Option<Offset24>

Source§

const SIZE: usize = Offset24::SIZE

Source§

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

Source§

impl FromData for Option<Offset32>

Source§

const SIZE: usize = Offset32::SIZE

Source§

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

Source§

impl FromData for i8

Source§

const SIZE: usize = 1

Source§

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

Source§

impl FromData for i16

Source§

const SIZE: usize = 2

Source§

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

Source§

impl FromData for i32

Source§

const SIZE: usize = 4

Source§

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

Source§

impl FromData for u8

Source§

const SIZE: usize = 1

Source§

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

Source§

impl FromData for u16

Source§

const SIZE: usize = 2

Source§

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

Source§

impl FromData for u32

Source§

const SIZE: usize = 4

Source§

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

Source§

impl FromData for u64

Source§

const SIZE: usize = 8

Source§

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

Source§

impl FromData for ()

Source§

const SIZE: usize = 0

Source§

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

Implementors§

Source§

impl FromData for CompositeMode

Source§

const SIZE: usize = 1

Source§

impl FromData for GradientExtend

Source§

const SIZE: usize = 1

Source§

impl FromData for PlatformId

Source§

const SIZE: usize = 2

Source§

impl FromData for Point

Source§

const SIZE: usize = 4

Source§

impl FromData for AxisValueMap

Source§

const SIZE: usize = 4

Source§

impl FromData for SettingName

Source§

const SIZE: usize = 4

Source§

impl FromData for Metrics

Source§

const SIZE: usize = 4

Source§

impl FromData for KerningPair

Source§

const SIZE: usize = 6

Source§

impl FromData for EntryData

Source§

const SIZE: usize = 2

Source§

impl FromData for GlyphPart

Source§

const SIZE: usize = 10

Source§

impl FromData for GlyphVariant

Source§

const SIZE: usize = 4

Source§

impl FromData for PartFlags

Source§

const SIZE: usize = 2

Source§

impl FromData for ContextualEntryData

Source§

const SIZE: usize = 4

Source§

impl FromData for Feature

Source§

const SIZE: usize = 12

Source§

impl FromData for InsertionEntryData

Source§

const SIZE: usize = 4

Source§

impl FromData for LookupFlags

Source§

const SIZE: usize = 2

Source§

impl FromData for RangeRecord

Source§

const SIZE: usize = 6

Source§

impl FromData for SequenceLookupRecord

Source§

const SIZE: usize = 4

Source§

impl FromData for AxisRecord

Source§

const SIZE: usize = 8

Source§

impl FromData for AxisValue

Source§

const SIZE: usize = 6

Source§

impl FromData for AxisValueSubtableFormat1

Source§

const SIZE: usize = 10

Source§

impl FromData for AxisValueSubtableFormat2

Source§

const SIZE: usize = 18

Source§

impl FromData for AxisValueSubtableFormat3

Source§

const SIZE: usize = 14

Source§

impl FromData for Fixed

Source§

const SIZE: usize = 4

Source§

impl FromData for GlyphId

Source§

const SIZE: usize = 2

Source§

impl FromData for TableRecord

Source§

const SIZE: usize = 16

Source§

impl FromData for Tag

Source§

const SIZE: usize = 4

Source§

impl FromData for VariationAxis

Source§

const SIZE: usize = 20

Source§

impl FromData for VerticalOriginMetrics

Source§

const SIZE: usize = 4

Source§

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