pub struct Stylesheet { /* private fields */ }Expand description
A list of style rules in source order.
Implementations§
Source§impl Stylesheet
impl Stylesheet
pub fn new() -> Self
Sourcepub fn parse(css: &str) -> Result<Self, Error>
pub fn parse(css: &str) -> Result<Self, Error>
Parses a stylesheet. The first problem is an error: an unknown property, a bad value, a selector this crate does not support, or an at-rule.
Sourcepub fn parse_lenient(css: &str) -> (Self, Vec<Error>)
pub fn parse_lenient(css: &str) -> (Self, Vec<Error>)
Like parse, but skips what it cannot parse the way a
browser would, and returns the problems alongside. A bad declaration
loses only itself; a bad selector loses its whole rule.
pub fn push(&mut self, rule: StyleRule)
pub fn rules(&self) -> &[StyleRule]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for Stylesheet
impl Clone for Stylesheet
Source§fn clone(&self) -> Stylesheet
fn clone(&self) -> Stylesheet
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Stylesheet
impl Debug for Stylesheet
Source§impl Default for Stylesheet
impl Default for Stylesheet
Source§fn default() -> Stylesheet
fn default() -> Stylesheet
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Stylesheet
impl RefUnwindSafe for Stylesheet
impl Send for Stylesheet
impl Sync for Stylesheet
impl Unpin for Stylesheet
impl UnsafeUnpin for Stylesheet
impl UnwindSafe for Stylesheet
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