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<'_>,
) -> Self
fn deep_clone_with_lock( &self, lock: &SharedRwLock, guard: &SharedRwLockReadGuard<'_>, ) -> Self
Deep clones this object.
Auto Trait Implementations§
impl Freeze for CssRules
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> 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> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
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