ttf_parser::parser

Trait NumFrom

Source
pub trait NumFrom<T>: Sized {
    // Required method
    fn num_from(_: T) -> Self;
}
Expand description

A safe u32 to usize casting.

Rust doesn’t implement From<u32> for usize, because it has to support 16 bit targets. We don’t, so we can allow this.

Required Methods§

Source

fn num_from(_: T) -> Self

Converts u32 into usize.

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 NumFrom<u32> for usize

Source§

fn num_from(v: u32) -> Self

Implementors§