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 (a padding or a margin). Missing sides are 0.
Written as one length for every side, as the CSS shorthand ("8px 16px":
one to four lengths, top first, clockwise, the 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 turned into fractions.
Trait Implementations§
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 Freeze 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