Struct taffy::compute::grid::track_sizing::ItemBatcher

source ·
struct ItemBatcher {
    axis: AbstractAxis,
    index_offset: usize,
    current_span: u16,
    current_is_flex: bool,
}
Expand description

Takes an axis, and a list of grid items sorted firstly by whether they cross a flex track in the specified axis (items that don’t cross a flex track first) and then by the number of tracks they cross in specified axis (ascending order).

Fields§

§axis: AbstractAxis

The axis in which the ItemBatcher is operating. Used when querying properties from items.

§index_offset: usize

The starting index of the current batch

§current_span: u16

The span of the items in the current batch

§current_is_flex: bool

Whether the current batch of items cross a flexible track

Implementations§

source§

impl ItemBatcher

source

fn new(axis: AbstractAxis) -> Self

Create a new ItemBatcher for the specified axis

source

fn next<'items>( &mut self, items: &'items mut [GridItem], ) -> Option<(&'items mut [GridItem], bool)>

This is basically a manual version of Iterator::next which passes items in as a parameter on each iteration to work around borrow checker rules

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