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.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