pub struct Insets {
pub top: u16,
pub right: u16,
pub bottom: u16,
pub left: u16,
}Expand description
Defines the padding between a component’s outer area and its children’s content area.
Return Insets from Component::content_inset
to reserve space for borders, padding, or other chrome. The framework
renders children inside the inset region, while the component’s
render method receives the full outer area
to draw its chrome.
§Construction
ⓘ
Insets::ZERO // no insets (default)
Insets::all(1) // 1-cell border on all sides
Insets::symmetric(1, 2) // 1 top/bottom, 2 left/right
Insets::new().top(1).left(2) // builder styleFields§
§top: u16Rows reserved above the content area.
right: u16Columns reserved to the right of the content area.
bottom: u16Rows reserved below the content area.
left: u16Columns reserved to the left of the content area.
Implementations§
Trait Implementations§
impl Copy for Insets
impl Eq for Insets
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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