Skip to main content

Run

Struct Run 

Source
pub struct Run {
    pub space: Space,
    pub raw: Vec2,
    pub at: Vec2,
    pub origin: Vec2,
    pub row: bool,
    pub start: f64,
    pub across: f64,
    pub gap: f64,
    pub line: f64,
    pub cut: Option<Rect>,
    /* private fields */
}
Expand description

A run’s children placed along it, and what they paint.

Fields§

§space: Space

The space its own node is in.

§raw: Vec2

Its node’s unrounded top-left and its rounded one, in its space.

§at: Vec2§origin: Vec2

Where its space’s origin was in the design’s coordinates when it was last placed: its children are placed in single precision there, as taffy places them, so they round where a whole tree’s do.

§row: bool

Whether its children go along x; else along y.

§start: f64

Where its first child starts along the run, from its node’s unrounded top-left: the padding and any justify offset.

§across: f64

Where its children’s line starts across, from the same: the padding.

§gap: f64

The gap between children.

§line: f64

The breadth of its children’s line.

§cut: Option<Rect>

What cuts it in its space: its clipping frames’ boxes.

Implementations§

Source§

impl Run

Source

pub fn new(space: Space) -> Run

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn place(&self, before: f64, across: f64) -> (Vec2, Vec2)

Where the run places a child: its unrounded top-left in the run’s space, and its rounded one — each edge where taffy’s pass puts it, measured from the run’s node, a box in the flow.

Source

pub fn child(&self, key: &OrderKey) -> Option<(f64, &Placed)>

The child at key: how far along the run the children before it advance, and how it is placed.

Source

pub fn prefix(&self, key: &OrderKey) -> f64

How far along the run the children before key advance.

Source

pub fn keys_after(&self, key: &OrderKey) -> Vec<OrderKey>

The keys of the children after key, in order.

Source

pub fn entry(&self) -> Option<KRect>

Its entry’s bounds in its space’s index.

Source

pub fn child_at(&self, key: &OrderKey) -> Option<Vec2>

Where the child at key is: its rounded top-left in the run’s space.

Source

pub fn children(&self) -> impl Iterator<Item = (&OrderKey, f64, &Placed)>

The children in order, each with how far the ones before it advance.

Auto Trait Implementations§

§

impl Freeze for Run

§

impl RefUnwindSafe for Run

§

impl Send for Run

§

impl Sync for Run

§

impl Unpin for Run

§

impl UnsafeUnpin for Run

§

impl UnwindSafe for Run

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> 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.