Struct style::stylesheets::rule_list::CssRules
source · pub struct CssRules(pub Vec<CssRule>);
Expand description
A list of CSS rules.
Tuple Fields§
§0: Vec<CssRule>
Implementations§
source§impl CssRules
impl CssRules
sourcepub fn new(
rules: Vec<CssRule>,
shared_lock: &SharedRwLock
) -> Arc<Locked<CssRules>>
pub fn new( rules: Vec<CssRule>, shared_lock: &SharedRwLock ) -> Arc<Locked<CssRules>>
Trivially construct a new set of CSS rules.
sourcefn only_ns_or_import(&self) -> bool
fn only_ns_or_import(&self) -> bool
Returns whether all the rules in this list are namespace or import rules.
sourcepub fn remove_rule(&mut self, index: usize) -> Result<(), RulesMutateError>
pub fn remove_rule(&mut self, index: usize) -> Result<(), RulesMutateError>
sourcepub fn to_css_block(
&self,
guard: &SharedRwLockReadGuard<'_>,
dest: &mut CssStringWriter
) -> Result
pub fn to_css_block( &self, guard: &SharedRwLockReadGuard<'_>, dest: &mut CssStringWriter ) -> Result
Serializes this CSSRules to CSS text as a block of rules.
This should be speced into CSSOM spec at some point. See https://github.com/w3c/csswg-drafts/issues/1985
sourcepub fn to_css_block_without_opening(
&self,
guard: &SharedRwLockReadGuard<'_>,
dest: &mut CssStringWriter
) -> Result
pub fn to_css_block_without_opening( &self, guard: &SharedRwLockReadGuard<'_>, dest: &mut CssStringWriter ) -> Result
As above, but without the opening curly bracket. That’s needed for nesting.
Trait Implementations§
source§impl DeepCloneWithLock for CssRules
impl DeepCloneWithLock for CssRules
source§fn deep_clone_with_lock(
&self,
lock: &SharedRwLock,
guard: &SharedRwLockReadGuard<'_>,
params: &DeepCloneParams
) -> Self
fn deep_clone_with_lock( &self, lock: &SharedRwLock, guard: &SharedRwLockReadGuard<'_>, params: &DeepCloneParams ) -> Self
Deep clones this object.
Auto Trait Implementations§
impl !RefUnwindSafe for CssRules
impl Send for CssRules
impl Sync for CssRules
impl Unpin for CssRules
impl !UnwindSafe for CssRules
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
source§impl<T> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert