pub struct ZIndex(/* private fields */);Expand description
Position of a widget inside an UI node list 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;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<Option<ZIndex>> for ZIndex
impl IntoValue<ZIndex> for u32
impl IntoValue<u32> for ZIndex
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 T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Clone the value.
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
Gets if
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
Swap value with
other if both are of the same type.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,
§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
Checks if this value is equivalent to the given key. Read more
§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