Struct style::rule_tree::StyleSource
source · pub struct StyleSource(Arc<Locked<PropertyDeclarationBlock>>);
Expand description
A style source for the rule node. It is a declaration block that may come from either a style rule or a standalone block like animations / transitions / smil / preshints / style attr…
Keeping the style rule around would provide more debugability, but also causes more pointer-chasing in the common code-path, which is undesired. If needed, we could keep it around in debug builds or something along those lines.
Tuple Fields§
§0: Arc<Locked<PropertyDeclarationBlock>>
Implementations§
source§impl StyleSource
impl StyleSource
pub(super) fn key(&self) -> NonNull<()>
sourcepub fn from_declarations(decls: Arc<Locked<PropertyDeclarationBlock>>) -> Self
pub fn from_declarations(decls: Arc<Locked<PropertyDeclarationBlock>>) -> Self
Creates a StyleSource from a PropertyDeclarationBlock.
pub(super) fn dump<W: Write>( &self, guard: &SharedRwLockReadGuard<'_>, writer: &mut W, )
sourcepub fn read<'a>(
&'a self,
guard: &'a SharedRwLockReadGuard<'_>,
) -> &'a PropertyDeclarationBlock
pub fn read<'a>( &'a self, guard: &'a SharedRwLockReadGuard<'_>, ) -> &'a PropertyDeclarationBlock
Read the style source guard, and obtain thus read access to the underlying property declaration block.
sourcepub fn get(&self) -> &Arc<Locked<PropertyDeclarationBlock>>
pub fn get(&self) -> &Arc<Locked<PropertyDeclarationBlock>>
Returns the declaration block if applicable, otherwise None.
Trait Implementations§
source§impl Clone for StyleSource
impl Clone for StyleSource
source§fn clone(&self) -> StyleSource
fn clone(&self) -> StyleSource
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 StyleSource
impl Debug for StyleSource
Auto Trait Implementations§
impl Freeze for StyleSource
impl !RefUnwindSafe for StyleSource
impl Send for StyleSource
impl Sync for StyleSource
impl Unpin for StyleSource
impl !UnwindSafe for StyleSource
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