pub struct SideOffsets {
pub top: Length,
pub right: Length,
pub bottom: Length,
pub left: Length,
}Expand description
2D size offsets in Length units.
This unit defines spacing around all four sides of a box, a widget margin can be defined using a value of this type.
Fields§
§top: LengthSpacing above, in length units.
right: LengthSpacing to the right, in length units.
bottom: LengthSpacing bellow, in length units.
left: LengthSpacing to the left ,in length units.
Implementations§
Source§impl SideOffsets
impl SideOffsets
Sourcepub fn new<T: Into<Length>, R: Into<Length>, B: Into<Length>, L: Into<Length>>(
top: T,
right: R,
bottom: B,
left: L,
) -> Self
pub fn new<T: Into<Length>, R: Into<Length>, B: Into<Length>, L: Into<Length>>( top: T, right: R, bottom: B, left: L, ) -> Self
New top, right, bottom left offsets. From any Length type.
Sourcepub fn new_vh<TB: Into<Length>, LR: Into<Length>>(
top_bottom: TB,
left_right: LR,
) -> Self
pub fn new_vh<TB: Into<Length>, LR: Into<Length>>( top_bottom: TB, left_right: LR, ) -> Self
Top-bottom and left-right equal. From any Length type.
Sourcepub fn dimensions_eq(&self) -> bool
pub fn dimensions_eq(&self) -> bool
If top and bottom are equal; and left and right are equal.
Trait Implementations§
Source§impl Add for SideOffsets
impl Add for SideOffsets
Source§impl AddAssign for SideOffsets
impl AddAssign for SideOffsets
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl Clone for SideOffsets
impl Clone for SideOffsets
Source§fn clone(&self) -> SideOffsets
fn clone(&self) -> SideOffsets
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SideOffsets
impl Debug for SideOffsets
Source§impl Default for SideOffsets
impl Default for SideOffsets
Source§fn default() -> SideOffsets
fn default() -> SideOffsets
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SideOffsets
impl<'de> Deserialize<'de> for SideOffsets
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<S: Into<FactorSideOffsets>> Div<S> for &SideOffsets
impl<S: Into<FactorSideOffsets>> Div<S> for &SideOffsets
Source§impl<S: Into<FactorSideOffsets>> Div<S> for SideOffsets
impl<S: Into<FactorSideOffsets>> Div<S> for SideOffsets
Source§impl<S: Into<FactorSideOffsets>> DivAssign<S> for SideOffsets
impl<S: Into<FactorSideOffsets>> DivAssign<S> for SideOffsets
Source§fn div_assign(&mut self, rhs: S)
fn div_assign(&mut self, rhs: S)
Performs the
/= operation. Read moreSource§impl<T, R, B, L> From<(T, R, B, L)> for SideOffsets
impl<T, R, B, L> From<(T, R, B, L)> for SideOffsets
Source§fn from((top, right, bottom, left): (T, R, B, L)) -> Self
fn from((top, right, bottom, left): (T, R, B, L)) -> Self
(top, right, bottom, left)
Source§impl<TB, LR> From<(TB, LR)> for SideOffsets
impl<TB, LR> From<(TB, LR)> for SideOffsets
Source§impl From<Factor> for SideOffsets
impl From<Factor> for SideOffsets
Source§impl From<FactorPercent> for SideOffsets
impl From<FactorPercent> for SideOffsets
Source§fn from(percent: FactorPercent) -> Self
fn from(percent: FactorPercent) -> Self
All sides equal relative length.
Source§impl From<SideOffsets2D<Dip, Dip>> for SideOffsets
impl From<SideOffsets2D<Dip, Dip>> for SideOffsets
Source§fn from(offsets: DipSideOffsets) -> Self
fn from(offsets: DipSideOffsets) -> Self
Converts to this type from the input type.
Source§impl From<SideOffsets2D<Px, Px>> for SideOffsets
impl From<SideOffsets2D<Px, Px>> for SideOffsets
Source§fn from(offsets: PxSideOffsets) -> Self
fn from(offsets: PxSideOffsets) -> Self
From exact lengths.
Source§impl FromStr for SideOffsets
impl FromStr for SideOffsets
Source§impl Hash for SideOffsets
impl Hash for SideOffsets
Source§impl<T, R, B, L> IntoVar<SideOffsets> for (T, R, B, L)
impl<T, R, B, L> IntoVar<SideOffsets> for (T, R, B, L)
Source§fn into_var(self) -> Var<SideOffsets>
fn into_var(self) -> Var<SideOffsets>
(top, right, bottom, left)
Source§impl<TB, LR> IntoVar<SideOffsets> for (TB, LR)
impl<TB, LR> IntoVar<SideOffsets> for (TB, LR)
Source§fn into_var(self) -> Var<SideOffsets>
fn into_var(self) -> Var<SideOffsets>
(top-bottom, left-right)
Source§impl IntoVar<SideOffsets> for Factor
impl IntoVar<SideOffsets> for Factor
Source§fn into_var(self) -> Var<SideOffsets>
fn into_var(self) -> Var<SideOffsets>
All sides equal relative length.
Source§impl IntoVar<SideOffsets> for FactorPercent
impl IntoVar<SideOffsets> for FactorPercent
Source§fn into_var(self) -> Var<SideOffsets>
fn into_var(self) -> Var<SideOffsets>
All sides equal relative length.
Source§impl IntoVar<SideOffsets> for Length
impl IntoVar<SideOffsets> for Length
Source§fn into_var(self) -> Var<SideOffsets>
fn into_var(self) -> Var<SideOffsets>
All sides equal.
Source§impl IntoVar<SideOffsets> for DipSideOffsets
impl IntoVar<SideOffsets> for DipSideOffsets
fn into_var(self) -> Var<SideOffsets>
Source§impl IntoVar<SideOffsets> for PxSideOffsets
impl IntoVar<SideOffsets> for PxSideOffsets
Source§fn into_var(self) -> Var<SideOffsets>
fn into_var(self) -> Var<SideOffsets>
From exact lengths.
Source§impl IntoVar<SideOffsets> for f32
impl IntoVar<SideOffsets> for f32
Source§fn into_var(self) -> Var<SideOffsets>
fn into_var(self) -> Var<SideOffsets>
All sides equal exact length.
Source§impl IntoVar<SideOffsets> for i32
impl IntoVar<SideOffsets> for i32
Source§fn into_var(self) -> Var<SideOffsets>
fn into_var(self) -> Var<SideOffsets>
All sides equal exact length.
Source§impl Layout2d for SideOffsets
impl Layout2d for SideOffsets
Source§fn layout_dft(&self, default: Self::Px) -> Self::Px
fn layout_dft(&self, default: Self::Px) -> Self::Px
Compute the pixel value in the current
LAYOUT context with default.Source§fn affect_mask(&self) -> LayoutMask
fn affect_mask(&self) -> LayoutMask
Compute a
LayoutMask that flags all contextual values that affect the result of layout.Source§impl<S: Into<FactorSideOffsets>> Mul<S> for &SideOffsets
impl<S: Into<FactorSideOffsets>> Mul<S> for &SideOffsets
Source§impl<S: Into<FactorSideOffsets>> Mul<S> for SideOffsets
impl<S: Into<FactorSideOffsets>> Mul<S> for SideOffsets
Source§impl<S: Into<FactorSideOffsets>> MulAssign<S> for SideOffsets
impl<S: Into<FactorSideOffsets>> MulAssign<S> for SideOffsets
Source§fn mul_assign(&mut self, rhs: S)
fn mul_assign(&mut self, rhs: S)
Performs the
*= operation. Read moreSource§impl PartialEq for SideOffsets
impl PartialEq for SideOffsets
Source§impl Serialize for SideOffsets
impl Serialize for SideOffsets
Source§impl Sub for SideOffsets
impl Sub for SideOffsets
Source§impl SubAssign for SideOffsets
impl SubAssign for SideOffsets
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreSource§impl Transitionable for SideOffsets
impl Transitionable for SideOffsets
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 Eq for SideOffsets
impl IntoValue<SideOffsets> for Factor
impl IntoValue<SideOffsets> for FactorPercent
impl IntoValue<SideOffsets> for Length
impl IntoValue<SideOffsets> for DipSideOffsets
impl IntoValue<SideOffsets> for PxSideOffsets
impl IntoValue<SideOffsets> for f32
impl IntoValue<SideOffsets> for i32
impl StructuralPartialEq for SideOffsets
Auto Trait Implementations§
impl Freeze for SideOffsets
impl RefUnwindSafe for SideOffsets
impl Send for SideOffsets
impl Sync for SideOffsets
impl Unpin for SideOffsets
impl UnwindSafe for SideOffsets
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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