ttf_parser::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.

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<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 ()

Source§

const SIZE: usize = 0usize

Source§

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

Implementors§

Source§

impl FromData for Format

Source§

const SIZE: usize = 2usize

Source§

impl FromData for PlatformId

Source§

const SIZE: usize = 2usize

Source§

impl FromData for Class

Source§

const SIZE: usize = 2usize

Source§

impl FromData for GlyphId

Source§

const SIZE: usize = 2usize

Source§

impl FromData for Tag

Source§

const SIZE: usize = 4usize

Source§

impl FromData for F2DOT14

Source§

const SIZE: usize = 2usize

Source§

impl FromData for Fixed

Source§

const SIZE: usize = 4usize

Source§

impl FromData for Offset16

Source§

const SIZE: usize = 2usize

Source§

impl FromData for Offset32

Source§

const SIZE: usize = 4usize

Source§

impl FromData for U24

Source§

const SIZE: usize = 3usize