Struct selectors::NthIndexCache
source · pub struct NthIndexCache {
nth: NthIndexCacheInner,
nth_of_selectors: NthIndexOfSelectorsCaches,
nth_last: NthIndexCacheInner,
nth_last_of_selectors: NthIndexOfSelectorsCaches,
nth_of_type: NthIndexCacheInner,
nth_last_of_type: NthIndexCacheInner,
}
Expand description
A cache to speed up matching of nth-index-like selectors.
See [1] for some discussion around the design tradeoffs.
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1401855#c3
Fields§
§nth: NthIndexCacheInner
§nth_of_selectors: NthIndexOfSelectorsCaches
§nth_last: NthIndexCacheInner
§nth_last_of_selectors: NthIndexOfSelectorsCaches
§nth_of_type: NthIndexCacheInner
§nth_last_of_type: NthIndexCacheInner
Implementations§
source§impl NthIndexCache
impl NthIndexCache
sourcepub fn get<Impl: SelectorImpl>(
&mut self,
is_of_type: bool,
is_from_end: bool,
selectors: &[Selector<Impl>]
) -> &mut NthIndexCacheInner
pub fn get<Impl: SelectorImpl>( &mut self, is_of_type: bool, is_from_end: bool, selectors: &[Selector<Impl>] ) -> &mut NthIndexCacheInner
Gets the appropriate cache for the given parameters.
Trait Implementations§
source§impl Default for NthIndexCache
impl Default for NthIndexCache
source§fn default() -> NthIndexCache
fn default() -> NthIndexCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for NthIndexCache
impl Send for NthIndexCache
impl !Sync for NthIndexCache
impl Unpin for NthIndexCache
impl UnwindSafe for NthIndexCache
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