Skip to main content

PatchGroup

Struct PatchGroup 

Source
pub struct PatchGroup<'a> { /* private fields */ }
Expand description

A group of patches derived from a single IFT font.

This is a group which can be applied simultaneously to that font. Patches are initially missing data which must be fetched and supplied to patch application method.

Also optionally includes a list of patches which are not compatible but have been requested to be preloaded.

Implementations§

Source§

impl PatchGroup<'_>

Source

pub fn select_next_patches<'b>( ift_font: FontRef<'b>, patch_data: &HashMap<PatchUrl, UrlStatus>, subset_definition: &SubsetDefinition, ) -> Result<PatchGroup<'b>, ReadError>

Intersect the available and unapplied patches in ift_font against subset_definition

patch_data provides any patch data that has been previously loaded, keyed by patch url. May be empty if no patch data is loaded yet.

Returns a group of patches which would be applied next.

Source

pub fn urls(&self) -> impl Iterator<Item = &PatchUrl>

Returns an iterator over URLs in this group.

Source

pub fn has_urls(&self) -> bool

Returns true if there is at least one url associated with this group.

Source

pub fn next_invalidating_patch(&self) -> Option<&PatchInfo>

Source

pub fn apply_next_patches( self, patch_data: &mut HashMap<PatchUrl, UrlStatus>, ) -> Result<Vec<u8>, PatchingError>

Attempt to apply the next patch (or patches if non-invalidating) listed in this group.

Returns the bytes of the updated font.

Source

pub fn apply_next_patches_with_decoder<D: SharedBrotliDecoder>( self, patch_data: &mut HashMap<PatchUrl, UrlStatus>, brotli_decoder: &D, ) -> Result<Vec<u8>, PatchingError>

Attempt to apply the next patch (or patches if non-invalidating) listed in this group.

Returns the bytes of the updated font.

Trait Implementations§

Source§

impl<'a> Clone for PatchGroup<'a>

Source§

fn clone(&self) -> PatchGroup<'a>

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 Debug for PatchGroup<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for PatchGroup<'a>

§

impl<'a> RefUnwindSafe for PatchGroup<'a>

§

impl<'a> Send for PatchGroup<'a>

§

impl<'a> Sync for PatchGroup<'a>

§

impl<'a> Unpin for PatchGroup<'a>

§

impl<'a> UnsafeUnpin for PatchGroup<'a>

§

impl<'a> UnwindSafe for PatchGroup<'a>

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