Struct style::stylesheet_set::SheetCollection
source · struct SheetCollection<S>where
S: StylesheetInDocument + PartialEq + 'static,{
entries: Vec<StylesheetSetEntry<S>>,
data_validity: DataValidity,
dirty: bool,
}
Fields§
§entries: Vec<StylesheetSetEntry<S>>
The actual list of stylesheets.
This is only a list of top-level stylesheets, and as such it doesn’t
include recursive @import
rules.
data_validity: DataValidity
The validity of the data that was already there for a given origin.
Note that an origin may appear on origins_dirty
, but still have
DataValidity::Valid
, if only sheets have been appended into it (in
which case the existing data is valid, but the origin needs to be
rebuilt).
dirty: bool
Whether anything in the collection has changed. Note that this is
different from data_validity
, in the sense that after a sheet append,
the data validity is still Valid
, but we need to be marked as dirty.
Implementations§
source§impl<S> SheetCollection<S>where
S: StylesheetInDocument + PartialEq + 'static,
impl<S> SheetCollection<S>where
S: StylesheetInDocument + PartialEq + 'static,
sourcefn get(&self, index: usize) -> Option<&S>
fn get(&self, index: usize) -> Option<&S>
Returns the index
th stylesheet in the set if present.
fn remove(&mut self, sheet: &S)
fn contains(&self, sheet: &S) -> bool
fn insert_before(&mut self, sheet: S, before_sheet: &S)
fn set_data_validity_at_least(&mut self, validity: DataValidity)
sourcefn iter(&self) -> StylesheetCollectionIterator<'_, S> ⓘ
fn iter(&self) -> StylesheetCollectionIterator<'_, S> ⓘ
Returns an iterator over the current list of stylesheets.
fn flush(&mut self) -> SheetCollectionFlusher<'_, S>
Trait Implementations§
source§impl<S> Default for SheetCollection<S>where
S: StylesheetInDocument + PartialEq + 'static,
impl<S> Default for SheetCollection<S>where
S: StylesheetInDocument + PartialEq + 'static,
source§impl<S> MallocSizeOf for SheetCollection<S>
impl<S> MallocSizeOf for SheetCollection<S>
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Auto Trait Implementations§
impl<S> Freeze for SheetCollection<S>
impl<S> RefUnwindSafe for SheetCollection<S>where
S: RefUnwindSafe,
impl<S> Send for SheetCollection<S>where
S: Send,
impl<S> Sync for SheetCollection<S>where
S: Sync,
impl<S> Unpin for SheetCollection<S>where
S: Unpin,
impl<S> UnwindSafe for SheetCollection<S>where
S: UnwindSafe,
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