Trait FontReadWithArgs

Source
pub trait FontReadWithArgs<'a>: Sized + ReadArgs {
    // Required method
    fn read_with_args(
        data: FontData<'a>,
        args: &Self::Args,
    ) -> Result<Self, ReadError>;
}
Expand description

A trait for types that require external data in order to be constructed.

You should not need to use this directly; it is intended to be used from generated code. Any type that requires external arguments also has a custom read constructor where you can pass those arguments like normal.

Required Methods§

Source

fn read_with_args( data: FontData<'a>, args: &Self::Args, ) -> Result<Self, ReadError>

read an item, using the provided args.

If successful, returns a new item of this type, and the number of bytes used to construct it.

If a type requires multiple arguments, they will be passed as a tuple.

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<'a, T: AnyBitPattern + FixedSize> FontReadWithArgs<'a> for &'a [T]

Source§

fn read_with_args(data: FontData<'a>, args: &u16) -> Result<Self, ReadError>

Implementors§

Source§

impl FontReadWithArgs<'_> for U16Or32

Source§

impl<'a> FontReadWithArgs<'a> for IndexSubtable<'a>

Source§

impl<'a> FontReadWithArgs<'a> for FeatureParams<'a>

Source§

impl<'a> FontReadWithArgs<'a> for Loca<'a>

Source§

impl<'a> FontReadWithArgs<'a> for Metadata<'a>

Source§

impl<'a> FontReadWithArgs<'a> for InstanceRecord<'a>

Source§

impl<'a> FontReadWithArgs<'a> for BaseRecord<'a>

Source§

impl<'a> FontReadWithArgs<'a> for Class1Record<'a>

Source§

impl<'a> FontReadWithArgs<'a> for Class2Record

Source§

impl<'a> FontReadWithArgs<'a> for ComponentRecord<'a>

Source§

impl<'a> FontReadWithArgs<'a> for Mark2Record<'a>

Source§

impl<'a> FontReadWithArgs<'a> for PairValueRecord

Source§

impl<'a> FontReadWithArgs<'a> for ValueRecord

Source§

impl<'a> FontReadWithArgs<'a> for DeviceRecord<'a>

Source§

impl<'a> FontReadWithArgs<'a> for Tuple<'a>

Source§

impl<'a> FontReadWithArgs<'a> for VariationRegion<'a>

Source§

impl<'a> FontReadWithArgs<'a> for IndexSubtable1<'a>

Source§

impl<'a> FontReadWithArgs<'a> for IndexSubtable3<'a>

Source§

impl<'a> FontReadWithArgs<'a> for IndexSubtableList<'a>

Source§

impl<'a> FontReadWithArgs<'a> for SettingNameArray<'a>

Source§

impl<'a> FontReadWithArgs<'a> for AxisInstanceArrays<'a>

Source§

impl<'a> FontReadWithArgs<'a> for BaseArray<'a>

Source§

impl<'a> FontReadWithArgs<'a> for LigatureArray<'a>

Source§

impl<'a> FontReadWithArgs<'a> for LigatureAttach<'a>

Source§

impl<'a> FontReadWithArgs<'a> for Mark2Array<'a>

Source§

impl<'a> FontReadWithArgs<'a> for PairSet<'a>

Source§

impl<'a> FontReadWithArgs<'a> for SharedTuples<'a>

Source§

impl<'a> FontReadWithArgs<'a> for Hdmx<'a>

Source§

impl<'a> FontReadWithArgs<'a> for Hmtx<'a>

Source§

impl<'a> FontReadWithArgs<'a> for Feature<'a>

Source§

impl<'a> FontReadWithArgs<'a> for Sbix<'a>

Source§

impl<'a> FontReadWithArgs<'a> for Strike<'a>

Source§

impl<'a> FontReadWithArgs<'a> for AxisValueArray<'a>

Source§

impl<'a> FontReadWithArgs<'a> for TupleVariationHeader<'a>

Source§

impl<'a> FontReadWithArgs<'a> for Vmtx<'a>

Source§

impl<'a, T> FontReadWithArgs<'a> for ComputedArray<'a, T>
where T: ComputeSize + FontReadWithArgs<'a>, T::Args: Copy,

Source§

impl<'a, T: FontRead<'a>> FontReadWithArgs<'a> for T