pub struct Portion { /* private fields */ }Expand description
The regions this instance touches and how much of the first and last is its own. Counted in the level below’s joint steps.
The steps are laid end to end and cut into one run an instance, every run ceil(steps / instances) long but the last that holds any, which holds what is left: the runs holding steps
come first, so no run between two that hold steps is empty, and the longest run, which is what
the level takes, is as short as an even split’s.
Implementations§
Source§impl Portion
impl Portion
Sourcepub fn index(&self, i: usize) -> usize
pub fn index(&self, i: usize) -> usize
The i-th region the portion touches, in the level’s flat index: one for every region of
the level, whichever instance touches it.
Sourcepub fn steps(&self, i: usize) -> (usize, usize)
pub fn steps(&self, i: usize) -> (usize, usize)
Start and length of this portion’s steps within the i-th region’s walk below.
Sourcepub fn holders(&self, i: usize) -> (usize, usize)
pub fn holders(&self, i: usize) -> (usize, usize)
The first run holding steps of the i-th region the portion touches, and how many runs
hold them. This run is one of them.
Sourcepub fn starts_in(&self, i: usize, run: usize) -> bool
pub fn starts_in(&self, i: usize, run: usize) -> bool
Whether run, one of the holders of the i-th region the portion
touches, starts there rather than in a region before it.
Sourcepub fn __expand_touched(
scope: &Scope,
this: &<Self as CubeType>::ExpandType,
) -> <usize as CubeType>::ExpandType
pub fn __expand_touched( scope: &Scope, this: &<Self as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType
How many regions the portion touches.
Sourcepub fn __expand_region(
scope: &Scope,
this: &<Self as CubeType>::ExpandType,
i: <usize as CubeType>::ExpandType,
) -> <Region as CubeType>::ExpandType
pub fn __expand_region( scope: &Scope, this: &<Self as CubeType>::ExpandType, i: <usize as CubeType>::ExpandType, ) -> <Region as CubeType>::ExpandType
The i-th region the portion touches.
Sourcepub fn __expand_index(
scope: &Scope,
this: &<Self as CubeType>::ExpandType,
i: <usize as CubeType>::ExpandType,
) -> <usize as CubeType>::ExpandType
pub fn __expand_index( scope: &Scope, this: &<Self as CubeType>::ExpandType, i: <usize as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType
The i-th region the portion touches, in the level’s flat index: one for every region of
the level, whichever instance touches it.
Sourcepub fn __expand_steps(
scope: &Scope,
this: &<Self as CubeType>::ExpandType,
i: <usize as CubeType>::ExpandType,
) -> (<usize as CubeType>::ExpandType, <usize as CubeType>::ExpandType)
pub fn __expand_steps( scope: &Scope, this: &<Self as CubeType>::ExpandType, i: <usize as CubeType>::ExpandType, ) -> (<usize as CubeType>::ExpandType, <usize as CubeType>::ExpandType)
Start and length of this portion’s steps within the i-th region’s walk below.
Sourcepub fn __expand_holders(
scope: &Scope,
this: &<Self as CubeType>::ExpandType,
i: <usize as CubeType>::ExpandType,
) -> (<usize as CubeType>::ExpandType, <usize as CubeType>::ExpandType)
pub fn __expand_holders( scope: &Scope, this: &<Self as CubeType>::ExpandType, i: <usize as CubeType>::ExpandType, ) -> (<usize as CubeType>::ExpandType, <usize as CubeType>::ExpandType)
The first run holding steps of the i-th region the portion touches, and how many runs
hold them. This run is one of them.
Sourcepub fn __expand_run(
scope: &Scope,
this: &<Self as CubeType>::ExpandType,
) -> <usize as CubeType>::ExpandType
pub fn __expand_run( scope: &Scope, this: &<Self as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType
This instance’s run, counted from the first.
Sourcepub fn __expand_starts_in(
scope: &Scope,
this: &<Self as CubeType>::ExpandType,
i: <usize as CubeType>::ExpandType,
run: <usize as CubeType>::ExpandType,
) -> <bool as CubeType>::ExpandType
pub fn __expand_starts_in( scope: &Scope, this: &<Self as CubeType>::ExpandType, i: <usize as CubeType>::ExpandType, run: <usize as CubeType>::ExpandType, ) -> <bool as CubeType>::ExpandType
Whether run, one of the holders of the i-th region the portion
touches, starts there rather than in a region before it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Portion
impl RefUnwindSafe for Portion
impl Send for Portion
impl Sync for Portion
impl Unpin for Portion
impl UnsafeUnpin for Portion
impl UnwindSafe for Portion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more