Struct selectors::relative_selector::cache::RelativeSelectorCache
source · pub struct RelativeSelectorCache {
cache: FxHashMap<Key, RelativeSelectorCachedMatch>,
}
Expand description
Cache to speed up matching of relative selectors.
Fields§
§cache: FxHashMap<Key, RelativeSelectorCachedMatch>
Implementations§
source§impl RelativeSelectorCache
impl RelativeSelectorCache
sourcepub fn add<Impl: SelectorImpl>(
&mut self,
anchor: OpaqueElement,
selector: &RelativeSelector<Impl>,
matched: RelativeSelectorCachedMatch
)
pub fn add<Impl: SelectorImpl>( &mut self, anchor: OpaqueElement, selector: &RelativeSelector<Impl>, matched: RelativeSelectorCachedMatch )
Add a relative selector match into the cache.
sourcepub fn lookup<Impl: SelectorImpl>(
&mut self,
element: OpaqueElement,
selector: &RelativeSelector<Impl>
) -> Option<RelativeSelectorCachedMatch>
pub fn lookup<Impl: SelectorImpl>( &mut self, element: OpaqueElement, selector: &RelativeSelector<Impl> ) -> Option<RelativeSelectorCachedMatch>
Check if we have a cache entry for the element.
Trait Implementations§
source§impl Default for RelativeSelectorCache
impl Default for RelativeSelectorCache
source§fn default() -> RelativeSelectorCache
fn default() -> RelativeSelectorCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for RelativeSelectorCache
impl Send for RelativeSelectorCache
impl !Sync for RelativeSelectorCache
impl Unpin for RelativeSelectorCache
impl UnwindSafe for RelativeSelectorCache
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