pub struct Stylesheet {
pub rules: Vec<CssRuleBlock>,
}
Fields§
§rules: Vec<CssRuleBlock>
The style rules making up the document - for example, de-duplicated CSS rules
Implementations§
Source§impl Stylesheet
impl Stylesheet
pub const fn new(rules: Vec<CssRuleBlock>) -> Self
Source§impl Stylesheet
impl Stylesheet
Sourcepub fn sort_by_specificity(&mut self)
pub fn sort_by_specificity(&mut self)
Sort the style rules by their weight, so that the rules are applied in the correct order. Should always be called when a new style is loaded from an external source.
Trait Implementations§
Source§impl Clone for Stylesheet
impl Clone for Stylesheet
Source§fn clone(&self) -> Stylesheet
fn clone(&self) -> Stylesheet
Returns a copy of the value. Read more
1.0.0 · 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
Source§impl From<Vec<CssRuleBlock>> for Stylesheet
impl From<Vec<CssRuleBlock>> for Stylesheet
Source§fn from(rules: Vec<CssRuleBlock>) -> Self
fn from(rules: Vec<CssRuleBlock>) -> Self
Converts to this type from the input type.
Source§impl PartialEq for Stylesheet
impl PartialEq for Stylesheet
Source§impl PartialOrd for Stylesheet
impl PartialOrd for Stylesheet
impl StructuralPartialEq for Stylesheet
Auto Trait Implementations§
impl Freeze for Stylesheet
impl RefUnwindSafe for Stylesheet
impl Send for Stylesheet
impl Sync for Stylesheet
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)