Skip to main content

Contours

Struct Contours 

Source
pub struct Contours { /* private fields */ }
Expand description

Every contour a book’s sheet asked for, traced once and kept by asset.

This is the trace stage. Nothing is traced because it is an image. It is traced because a rule that matched it resolved to shape-outside: auto, and that is not reachable from where probing happens: probing takes a book and a loader, and neither has seen the style tree.

The stage sits above line breaking, because a contour that moved is a measure that moved. It keeps what an earlier run traced, so a sheet edit that leaves the contours where they were decodes nothing.

Implementations§

Source§

impl Contours

Source

pub fn none() -> Contours

Nothing traced: what a book whose sheet names no contour carries.

Source

pub fn update( &mut self, book: &Book, styles: &StyleTree, assets: &Assets, ) -> u32

Traces every asset the cascade asks for and this table does not already answer for, and reports how many images it decoded.

A book whose sheet names no contour decodes nothing, and so does one whose contours are all traced already.

Source

pub fn get(&self, asset: u32) -> Option<&Contour>

The contour one asset traced to, and None where it traced to nothing or was never asked for.

Source

pub fn traces(&self, asset: u32) -> bool

Whether this table holds a trace of one asset, whatever the trace found.

Source

pub fn warnings(&self) -> &[Warning]

What tracing had to complain about.

Trait Implementations§

Source§

impl Debug for Contours

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Contours

Source§

fn default() -> Contours

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

Auto Trait Implementations§

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
§

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

§

impl<T> Finish for T

§

fn finish(self)

Does nothing but move self, equivalent to drop.
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.

§

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

§

fn to_owned_table(&self) -> U

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.