Skip to main content

ParsedRule

Struct ParsedRule 

Source
struct ParsedRule<'a, const W: usize> {
    backtrack: Values<'a, W>,
    input: Values<'a, W>,
    lookahead: Values<'a, W>,
    records: &'a [SequenceLookupRecord],
    chained: bool,
}
Expand description

A rule’s fields, parsed in one pass. Glyph IDs and classes are both read as plain values of W bytes; a sequence rule has no backtrack or lookahead.

Fields§

§backtrack: Values<'a, W>§input: Values<'a, W>§lookahead: Values<'a, W>§records: &'a [SequenceLookupRecord]§chained: bool

Implementations§

Source§

impl<'a, const W: usize> ParsedRule<'a, W>

Source

fn parse(data: FontData<'a>, layout: RuleLayout) -> Self

Parses a rule; an unreadable one is empty.

Source

fn try_parse(data: FontData<'a>, layout: RuleLayout) -> Option<Self>

Source

fn try_plain(data: FontData<'a>) -> Option<Self>

Parses a sequence rule or class sequence rule.

Source

fn try_chain(data: FontData<'a>) -> Option<Self>

Parses a chained sequence rule or chained class sequence rule.

Source

fn apply( &self, ctx: &mut ApplyContext<'_, '_, '_>, matchers: &ChainMatchers<impl Matcher, impl Matcher, impl Matcher>, ) -> Option<()>

Matches the input, lookahead and backtrack sequences in that order and applies the lookup records.

Trait Implementations§

Source§

impl<'a, const W: usize> Clone for ParsedRule<'a, W>

Source§

fn clone(&self) -> ParsedRule<'a, W>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, const W: usize> Copy for ParsedRule<'a, W>

Source§

impl<'a, const W: usize> Default for ParsedRule<'a, W>

Source§

fn default() -> ParsedRule<'a, W>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a, const W: usize> Freeze for ParsedRule<'a, W>

§

impl<'a, const W: usize> RefUnwindSafe for ParsedRule<'a, W>

§

impl<'a, const W: usize> Send for ParsedRule<'a, W>

§

impl<'a, const W: usize> Sync for ParsedRule<'a, W>

§

impl<'a, const W: usize> Unpin for ParsedRule<'a, W>

§

impl<'a, const W: usize> UnsafeUnpin for ParsedRule<'a, W>

§

impl<'a, const W: usize> UnwindSafe for ParsedRule<'a, W>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.