Struct style::data::EagerPseudoStyles
source · pub struct EagerPseudoStyles(Option<Arc<EagerPseudoArray>>);
Expand description
A lazily-allocated list of styles for eagerly-cascaded pseudo-elements.
We use an Arc so that sharing these styles via the style sharing cache does not require duplicate allocations. We leverage the copy-on-write semantics of Arc::make_mut(), which is free (i.e. does not require atomic RMU operations) in servo_arc.
Tuple Fields§
§0: Option<Arc<EagerPseudoArray>>
Implementations§
source§impl EagerPseudoStyles
impl EagerPseudoStyles
sourcepub fn as_optional_array(&self) -> Option<&[Option<Arc<ComputedValues>>; 3]>
pub fn as_optional_array(&self) -> Option<&[Option<Arc<ComputedValues>>; 3]>
Grabs a reference to the list of styles, if they exist.
sourcepub fn as_array(&self) -> &[Option<Arc<ComputedValues>>; 3]
pub fn as_array(&self) -> &[Option<Arc<ComputedValues>>; 3]
Grabs a reference to the list of styles or a list of None if there are no styles to be had.
sourcepub fn get(&self, pseudo: &PseudoElement) -> Option<&Arc<ComputedValues>>
pub fn get(&self, pseudo: &PseudoElement) -> Option<&Arc<ComputedValues>>
Returns a reference to the style for a given eager pseudo, if it exists.
sourcepub fn set(&mut self, pseudo: &PseudoElement, value: Arc<ComputedValues>)
pub fn set(&mut self, pseudo: &PseudoElement, value: Arc<ComputedValues>)
Sets the style for the eager pseudo.
Trait Implementations§
source§impl Clone for EagerPseudoStyles
impl Clone for EagerPseudoStyles
source§fn clone(&self) -> EagerPseudoStyles
fn clone(&self) -> EagerPseudoStyles
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 EagerPseudoStyles
impl Debug for EagerPseudoStyles
source§impl Default for EagerPseudoStyles
impl Default for EagerPseudoStyles
source§fn default() -> EagerPseudoStyles
fn default() -> EagerPseudoStyles
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for EagerPseudoStyles
impl Send for EagerPseudoStyles
impl Sync for EagerPseudoStyles
impl Unpin for EagerPseudoStyles
impl !UnwindSafe for EagerPseudoStyles
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>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,
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, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
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