pub struct Padding {
pub top: u32,
pub right: u32,
pub bottom: u32,
pub left: u32,
}Expand description
Padding inside a container border.
Shrinks the content area inward from each edge. All values are in terminal columns/rows.
Fields§
§top: u32Padding on the top edge.
right: u32Padding on the right edge.
bottom: u32Padding on the bottom edge.
left: u32Padding on the left edge.
Implementations§
Source§impl Padding
impl Padding
Sourcepub const fn xy(x: u32, y: u32) -> Self
pub const fn xy(x: u32, y: u32) -> Self
Create padding with x on left/right and y on top/bottom.
Sourcepub const fn new(top: u32, right: u32, bottom: u32, left: u32) -> Self
pub const fn new(top: u32, right: u32, bottom: u32, left: u32) -> Self
Create padding with explicit values for each side.
Sourcepub const fn horizontal(self) -> u32
pub const fn horizontal(self) -> u32
Total horizontal padding (left + right).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Padding
impl<'de> Deserialize<'de> for Padding
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
impl Copy for Padding
impl Eq for Padding
impl StructuralPartialEq for Padding
Auto Trait Implementations§
impl Freeze for Padding
impl RefUnwindSafe for Padding
impl Send for Padding
impl Sync for Padding
impl Unpin for Padding
impl UnsafeUnpin for Padding
impl UnwindSafe for Padding
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