#[non_exhaustive]pub enum Padding {
Top(NonNegativeLengthPercentageValue),
Right(NonNegativeLengthPercentageValue),
Bottom(NonNegativeLengthPercentageValue),
Left(NonNegativeLengthPercentageValue),
All(NonNegativeLengthPercentageValue),
Double(NonNegativeLengthPercentageValue, NonNegativeLengthPercentageValue),
Full(NonNegativeLengthPercentageValue, NonNegativeLengthPercentageValue, NonNegativeLengthPercentageValue, NonNegativeLengthPercentageValue),
}Expand description
CSS padding shorthand values.
Mirrors the Margin type but for the padding property.
All(dim)→padding: dimDouble(v, h)→padding: v hFull(t, r, b, l)→padding: t r b lTop(dim)→padding: dim 0 0 0(and similarly for other sides)
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Top(NonNegativeLengthPercentageValue)
Only on the top edge (other edges are 0).
Right(NonNegativeLengthPercentageValue)
Only on the right edge (other edges are 0).
Bottom(NonNegativeLengthPercentageValue)
Only on the bottom edge (other edges are 0).
Left(NonNegativeLengthPercentageValue)
Only on the left edge (other edges are 0).
All(NonNegativeLengthPercentageValue)
Equal on all four edges.
Double(NonNegativeLengthPercentageValue, NonNegativeLengthPercentageValue)
Separate vertical (top/bottom) and horizontal (left/right).
Full(NonNegativeLengthPercentageValue, NonNegativeLengthPercentageValue, NonNegativeLengthPercentageValue, NonNegativeLengthPercentageValue)
Explicit for each edge: top, right, bottom, left.
Implementations§
Source§impl Padding
impl Padding
Sourcepub fn all(value: CssDimension) -> Self
pub fn all(value: CssDimension) -> Self
Construct equal padding on all four edges.
Sourcepub fn double(vertical: CssDimension, horizontal: CssDimension) -> Self
pub fn double(vertical: CssDimension, horizontal: CssDimension) -> Self
Construct vertical and horizontal padding.
Sourcepub fn full(
top: CssDimension,
right: CssDimension,
bottom: CssDimension,
left: CssDimension,
) -> Self
pub fn full( top: CssDimension, right: CssDimension, bottom: CssDimension, left: CssDimension, ) -> Self
Construct explicit top, right, bottom, and left padding.
Sourcepub fn calculated(expression: impl Into<CssDimensionExpr>) -> Self
pub fn calculated(expression: impl Into<CssDimensionExpr>) -> Self
Construct equal calculated padding on all four edges.
Trait Implementations§
Source§impl CssWriteTo for Padding
impl CssWriteTo 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
impl<T> CheckedCssValue for Twhere
T: CssWriteTo + Sealed,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.