pub struct StyleObject { /* private fields */ }Expand description
A Record<string, string> of CSS properties, as
get_style_object_from_css returns it: keys in JS’s property order
(array indices first, ascending, then the rest in the order they were
first set), so iterating it writes CSS in the order JS does.
Implementations§
Source§impl StyleObject
impl StyleObject
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, key: &str) -> Option<&str>
pub fn contains_key(&self, key: &str) -> bool
Sourcepub fn insert(&mut self, key: impl Into<String>, value: impl Into<String>)
pub fn insert(&mut self, key: impl Into<String>, value: impl Into<String>)
styles[key] = value: an existing key keeps its position.
pub fn iter(&self) -> impl Iterator<Item = (&str, &str)>
pub fn keys(&self) -> impl Iterator<Item = &str>
Trait Implementations§
Source§impl Clone for StyleObject
impl Clone for StyleObject
Source§impl Debug for StyleObject
impl Debug for StyleObject
Source§impl Default for StyleObject
impl Default for StyleObject
impl Eq for StyleObject
Source§impl<K: Into<String>, V: Into<String>> FromIterator<(K, V)> for StyleObject
impl<K: Into<String>, V: Into<String>> FromIterator<(K, V)> for StyleObject
Source§impl IntoIterator for StyleObject
impl IntoIterator for StyleObject
Source§impl PartialEq for StyleObject
impl PartialEq for StyleObject
impl StructuralPartialEq for StyleObject
Auto Trait Implementations§
impl Forget for StyleObject
impl Freeze for StyleObject
impl Move for StyleObject
impl RefUnwindSafe for StyleObject
impl Send for StyleObject
impl Sync for StyleObject
impl Unpin for StyleObject
impl UnsafeUnpin for StyleObject
impl UnwindSafe for StyleObject
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