pub struct StyleDeclarationBlock {
pub declarations: SmallVec<[StyleDeclaration; 8]>,
pub importance: DeclarationImportance,
}Expand description
Ordered specified declarations plus the set of important properties.
Fields§
§declarations: SmallVec<[StyleDeclaration; 8]>Ordered declarations in source order.
importance: DeclarationImportanceProperties that were marked with !important.
Implementations§
Source§impl StyleDeclarationBlock
impl StyleDeclarationBlock
Sourcepub fn push(&mut self, declaration: StyleDeclaration, important: bool)
pub fn push(&mut self, declaration: StyleDeclaration, important: bool)
Appends a declaration and records whether it was important.
pub fn append(&mut self, other: Self)
Sourcepub fn iter(&self) -> Iter<'_, StyleDeclaration>
pub fn iter(&self) -> Iter<'_, StyleDeclaration>
Iterates over the declarations in source order.
Sourcepub fn resource_urls(&self) -> impl Iterator<Item = &str>
pub fn resource_urls(&self) -> impl Iterator<Item = &str>
Collects resource URLs referenced by declarations in this block.
pub fn parse<'i>( name: &str, input: &mut Parser<'i, '_>, ) -> ParseResult<'i, Self>
Trait Implementations§
Source§impl Clone for StyleDeclarationBlock
impl Clone for StyleDeclarationBlock
Source§fn clone(&self) -> StyleDeclarationBlock
fn clone(&self) -> StyleDeclarationBlock
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 StyleDeclarationBlock
impl Debug for StyleDeclarationBlock
Source§impl Default for StyleDeclarationBlock
impl Default for StyleDeclarationBlock
Source§fn default() -> StyleDeclarationBlock
fn default() -> StyleDeclarationBlock
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for StyleDeclarationBlock
impl<'de> Deserialize<'de> for StyleDeclarationBlock
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Style> for StyleDeclarationBlock
impl From<Style> for StyleDeclarationBlock
Source§impl From<StyleDeclarationBlock> for Style
impl From<StyleDeclarationBlock> for Style
Source§fn from(declarations: StyleDeclarationBlock) -> Self
fn from(declarations: StyleDeclarationBlock) -> Self
Converts to this type from the input type.
Source§impl FromStr for StyleDeclarationBlock
impl FromStr for StyleDeclarationBlock
Source§impl PartialEq for StyleDeclarationBlock
impl PartialEq for StyleDeclarationBlock
Source§fn eq(&self, other: &StyleDeclarationBlock) -> bool
fn eq(&self, other: &StyleDeclarationBlock) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for StyleDeclarationBlock
Auto Trait Implementations§
impl Freeze for StyleDeclarationBlock
impl RefUnwindSafe for StyleDeclarationBlock
impl Send for StyleDeclarationBlock
impl Sync for StyleDeclarationBlock
impl Unpin for StyleDeclarationBlock
impl UnsafeUnpin for StyleDeclarationBlock
impl UnwindSafe for StyleDeclarationBlock
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