pub struct Insets {
pub top: LayoutSize,
pub right: LayoutSize,
pub bottom: LayoutSize,
pub left: LayoutSize,
}Expand description
A length on each side of a box (padding or margin). Missing sides are 0.
Written as one length, as the CSS shorthand ("8px 16px": one to four lengths, top first,
clockwise, missing ones repeating the opposite side), or as the sides object.
Fields§
§top: LayoutSizeTop side.
right: LayoutSizeRight side.
bottom: LayoutSizeBottom side.
left: LayoutSizeLeft side.
Implementations§
Source§impl Insets
impl Insets
Sourcepub const fn sides(self) -> [LayoutSize; 4]
pub const fn sides(self) -> [LayoutSize; 4]
The sides, top first, clockwise.
Sourcepub const fn from_sides([top, right, bottom, left]: [LayoutSize; 4]) -> Self
pub const fn from_sides([top, right, bottom, left]: [LayoutSize; 4]) -> Self
Insets from sides, top first, clockwise.
Sourcepub fn without_px(self, shorter_side: f32) -> Self
pub fn without_px(self, shorter_side: f32) -> Self
The same insets with pixels converted to fractions.
Trait Implementations§
Source§impl AnimatedValue for Insets
impl AnimatedValue for Insets
Source§const ACCEPTS_DATA: bool = false
const ACCEPTS_DATA: bool = false
Whether the type takes the
data value mode.Source§const INTERPOLATES: bool = true
const INTERPOLATES: bool = true
Whether keyframes of the type can interpolate; those of the others only hold.
Source§const OFFSETS: bool = false
const OFFSETS: bool = false
Whether two values of the type have a difference to add: what
repeat_offset needs.Source§const VALUE_CURVES: bool = false
const VALUE_CURVES: bool = false
Whether a keyframe of the type can start a value curve (
ValueBezier).Source§const SPLIT: Option<(usize, usize)> = None
const SPLIT: Option<(usize, usize)> = None
The fewest and the most channels the type’s
split mode takes, or None for a type
without the mode.Source§fn takes_value_curve(&self) -> bool
fn takes_value_curve(&self) -> bool
Whether a keyframe holding this value may start or end a value curve.
Source§fn extrapolates(&self, extrapolation: Extrapolation) -> bool
fn extrapolates(&self, extrapolation: Extrapolation) -> bool
Whether keyframes holding this value may extrapolate by
extrapolation.impl Copy for Insets
Source§impl<'de> Deserialize<'de> for Insets
impl<'de> Deserialize<'de> for Insets
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Insets
Auto Trait Implementations§
impl Forget for Insets
impl Freeze for Insets
impl Move for Insets
impl RefUnwindSafe for Insets
impl Send for Insets
impl Sync for Insets
impl Unpin for Insets
impl UnsafeUnpin for Insets
impl UnwindSafe for Insets
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
Mutably borrows from an owned value. Read more