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