pub struct ZIndex(pub u32);
Expand description
Position of a widget inside an UiNodeList
render operation.
When two widgets have the same index their logical position defines the render order.
§Examples
Create a Z-index that causes the widget to render in front of all siblings that don’t set Z-index.
let highlight_z = ZIndex::DEFAULT + 1;
Tuple Fields§
§0: u32
Implementations§
source§impl ZIndex
impl ZIndex
sourcepub const BACK: ZIndex = _
pub const BACK: ZIndex = _
Widget is rendered first causing all overlapping siblings to render on top of it.
The value is 0
.
sourcepub const DEFAULT: ZIndex = _
pub const DEFAULT: ZIndex = _
Z-index of widgets that don’t set the index.
The value is u32::MAX / 2
.
sourcepub fn saturating_add(self, other: impl Into<Self>) -> Self
pub fn saturating_add(self, other: impl Into<Self>) -> Self
Computes other
above self
, caps at FRONT
.
This is the default ZIndex addition, equivalent to self + other
.
sourcepub fn saturating_sub(self, other: impl Into<Self>) -> Self
pub fn saturating_sub(self, other: impl Into<Self>) -> Self
Computes other
below self
, stops at BACK
.
This is the default ZIndex subtraction, equivalent to self - other
.
Trait Implementations§
source§impl<Z: Into<ZIndex>> AddAssign<Z> for ZIndex
impl<Z: Into<ZIndex>> AddAssign<Z> for ZIndex
source§fn add_assign(&mut self, rhs: Z)
fn add_assign(&mut self, rhs: Z)
Performs the
+=
operation. Read moresource§impl DivAssign<Factor> for ZIndex
impl DivAssign<Factor> for ZIndex
source§fn div_assign(&mut self, rhs: Factor)
fn div_assign(&mut self, rhs: Factor)
Performs the
/=
operation. Read moresource§impl MulAssign<Factor> for ZIndex
impl MulAssign<Factor> for ZIndex
source§fn mul_assign(&mut self, rhs: Factor)
fn mul_assign(&mut self, rhs: Factor)
Performs the
*=
operation. Read moresource§impl Ord for ZIndex
impl Ord for ZIndex
source§impl PartialOrd for ZIndex
impl PartialOrd for ZIndex
source§impl<Z: Into<ZIndex>> SubAssign<Z> for ZIndex
impl<Z: Into<ZIndex>> SubAssign<Z> for ZIndex
source§fn sub_assign(&mut self, rhs: Z)
fn sub_assign(&mut self, rhs: Z)
Performs the
-=
operation. Read moresource§impl Transitionable for ZIndex
impl Transitionable for ZIndex
source§fn lerp(self, to: &Self, step: EasingStep) -> Self
fn lerp(self, to: &Self, step: EasingStep) -> Self
Sample the linear interpolation from
self
-> to
by step
.impl Copy for ZIndex
impl Eq for ZIndex
impl IntoValue<ZIndex> for u32
impl StructuralPartialEq for ZIndex
Auto Trait Implementations§
impl Freeze for ZIndex
impl RefUnwindSafe for ZIndex
impl Send for ZIndex
impl Sync for ZIndex
impl Unpin for ZIndex
impl UnwindSafe for ZIndex
Blanket Implementations§
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Access to mut
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
Clone the value.
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
Clone the value into a new boxed
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
Gets if
self
equals other
.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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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