Trait FontReadWithArgs

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§

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§

§

impl<'a, T> FontReadWithArgs<'a> for &'a [T]
where T: AnyBitPattern + FixedSize,

§

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

Implementors§

§

impl FontReadWithArgs<'_> for U16Or32

§

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

§

impl<'a> FontReadWithArgs<'a> for Subtable<'a>

§

impl<'a> FontReadWithArgs<'a> for cosmic::iced::daemon::program::graphics::text::cosmic_text::skrifa::raw::tables::kern::SubtableKind<'a>

§

impl<'a> FontReadWithArgs<'a> for Subtable6<'a>

§

impl<'a> FontReadWithArgs<'a> for cosmic::iced::daemon::program::graphics::text::cosmic_text::skrifa::raw::tables::kerx::SubtableKind<'a>

§

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

§

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

§

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

§

impl<'a> FontReadWithArgs<'a> for cosmic::iced::daemon::program::graphics::text::cosmic_text::skrifa::raw::tables::morx::SubtableKind<'a>

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<'a> FontReadWithArgs<'a> for Subtable2<'a>

§

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

§

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

§

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

§

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