pub struct Style { /* private fields */ }Expand description
A collection of CSS style properties that can be converted to a style string.
Implementations§
Source§impl Style
Implementation of style CSS serialization.
impl Style
Implementation of style CSS serialization.
Sourcepub fn property<N, V>(self, name: N, value: V) -> Self
pub fn property<N, V>(self, name: N, value: V) -> Self
Adds a style property.
Property names are automatically converted from snake_case to kebab-case
(e.g., flex_direction becomes flex-direction).
Sourcepub fn to_css_string(&self) -> String
pub fn to_css_string(&self) -> String
Converts the style to a CSS string.
Source§impl Style
impl Style
pub fn get_properties(&self) -> &Vec<StyleProperty>
pub fn get_mut_properties(&mut self) -> &mut Vec<StyleProperty>
pub fn set_properties(&mut self, val: Vec<StyleProperty>) -> &mut Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnsafeUnpin for Style
impl UnwindSafe for Style
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