CssProperty

Enum CssProperty 

Source
#[repr(u8)]
pub enum CssProperty {
Show 23 variants BackgroundColor = 0, BorderBottomWidth = 1, BorderColor = 2, BorderRightStyle = 3, BorderRightWidth = 4, BorderTopWidth = 5, BorderStyle = 6, BorderWidth = 7, Bottom = 8, Color = 9, Height = 10, Left = 11, Margin = 12, MarginLeft = 13, MarginRight = 14, MarginTop = 15, MinWidth = 16, PaddingLeft = 17, Position = 18, TextShadow = 19, Top = 20, Width = 21, VerticalAlign = 22,
}
Expand description

Represents a set of standard CSS property names.

This enum is serialized in kebab-case (the standard CSS syntax) via strum. It can be used for mapping strongly-typed property names to their CSS strings and is especially useful when generating styles programmatically.

Variants§

§

BackgroundColor = 0

Sets the background color of an element. See: https://developer.mozilla.org/docs/Web/CSS/background-color

§

BorderBottomWidth = 1

Sets the width of the bottom border of an element. See: https://developer.mozilla.org/docs/Web/CSS/border-bottom-width

§

BorderColor = 2

Sets the color of the border on all four sides of an element. See: https://developer.mozilla.org/docs/Web/CSS/border-color

§

BorderRightStyle = 3

Sets the style of the right border. See: https://developer.mozilla.org/docs/Web/CSS/border-right-style

§

BorderRightWidth = 4

Sets the width of the right border of an element. See: https://developer.mozilla.org/docs/Web/CSS/border-right-width

§

BorderTopWidth = 5

Sets the width of the top border of an element. See: https://developer.mozilla.org/docs/Web/CSS/border-top-width

§

BorderStyle = 6

Sets the style of all four borders. See: https://developer.mozilla.org/docs/Web/CSS/border-style

§

BorderWidth = 7

Sets the width of all four borders. See: https://developer.mozilla.org/docs/Web/CSS/border-width

§

Bottom = 8

Specifies how far the bottom edge of an element is from the bottom edge of its containing block. See: https://developer.mozilla.org/docs/Web/CSS/bottom

§

Color = 9

Sets the color of the text content of an element. See: https://developer.mozilla.org/docs/Web/CSS/color

§

Height = 10

Specifies the height of an element. See: https://developer.mozilla.org/docs/Web/CSS/height

§

Left = 11

Specifies how far the left edge of an element is from the left edge of its containing block. See: https://developer.mozilla.org/docs/Web/CSS/left

§

Margin = 12

Sets the margin area on all four sides of an element. See: https://developer.mozilla.org/docs/Web/CSS/margin

§

MarginLeft = 13

Sets the margin area on the left side of an element. See: https://developer.mozilla.org/docs/Web/CSS/margin-left

§

MarginRight = 14

Sets the margin area on the right side of an element. See: https://developer.mozilla.org/docs/Web/CSS/margin-right

§

MarginTop = 15

Sets the margin area on the top side of an element. See: https://developer.mozilla.org/docs/Web/CSS/margin-top

§

MinWidth = 16

Sets the minimum width of an element. See: https://developer.mozilla.org/docs/Web/CSS/min-width

§

PaddingLeft = 17

Sets the padding on the left side of an element. See: https://developer.mozilla.org/docs/Web/CSS/padding-left

§

Position = 18

Specifies how an element is positioned in the document. See: https://developer.mozilla.org/docs/Web/CSS/position

§

TextShadow = 19

Applies one or more shadows to text. See: https://developer.mozilla.org/docs/Web/CSS/text-shadow

§

Top = 20

Specifies how far the top edge of an element is from the top edge of its containing block. See: https://developer.mozilla.org/docs/Web/CSS/top

§

Width = 21

Specifies the width of an element. See: https://developer.mozilla.org/docs/Web/CSS/width

§

VerticalAlign = 22

Sets the vertical alignment of an inline or table-cell element. See: https://developer.mozilla.org/docs/Web/CSS/vertical-align

Implementations§

Source§

impl CssProperty

Source

pub const fn from_repr(discriminant: u8) -> Option<CssProperty>

Try to create Self from the raw representation

Trait Implementations§

Source§

impl AsRef<str> for CssProperty

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for CssProperty

Source§

fn clone(&self) -> CssProperty

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CssProperty

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CssProperty

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl EnumCount for CssProperty

Source§

const COUNT: usize = 23usize

Source§

impl Hash for CssProperty

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl IntoEnumIterator for CssProperty

Source§

impl Ord for CssProperty

Source§

fn cmp(&self, other: &CssProperty) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for CssProperty

Source§

fn eq(&self, other: &CssProperty) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for CssProperty

Source§

fn partial_cmp(&self, other: &CssProperty) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for CssProperty

Source§

impl Eq for CssProperty

Source§

impl StructuralPartialEq for CssProperty

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.