pub struct SelectorMatch { /* private fields */ }Expand description
Holds the result of a selector match.
A selector match describes whether and how a selector matches a control, and in addition whether the selector can ever match a control of the same type.
Implementations§
Source§impl SelectorMatch
impl SelectorMatch
Sourcepub const NEVER_THIS_TYPE: SelectorMatch
pub const NEVER_THIS_TYPE: SelectorMatch
A selector match with the result of SelectorMatchResult::NeverThisType.
Sourcepub const NEVER_THIS_INSTANCE: SelectorMatch
pub const NEVER_THIS_INSTANCE: SelectorMatch
A selector match with the result of SelectorMatchResult::NeverThisInstance.
Sourcepub const ALWAYS_THIS_TYPE: SelectorMatch
pub const ALWAYS_THIS_TYPE: SelectorMatch
A selector match with the result of SelectorMatchResult::AlwaysThisType.
Sourcepub const ALWAYS_THIS_INSTANCE: SelectorMatch
pub const ALWAYS_THIS_INSTANCE: SelectorMatch
A selector match with the result of SelectorMatchResult::AlwaysThisInstance.
Sourcepub fn sometimes(activator: Rc<dyn IStyleActivator>) -> Self
pub fn sometimes(activator: Rc<dyn IStyleActivator>) -> Self
Creates a match with a SelectorMatchResult::Sometimes result,
whose state is tracked by activator.
Sourcepub const fn new(result: SelectorMatchResult) -> Self
pub const fn new(result: SelectorMatchResult) -> Self
Creates a match with the specified result and no activator.
Sourcepub fn is_match(&self) -> bool
pub fn is_match(&self) -> bool
Whether the match was positive.
The match is positive if the result is Sometimes,
AlwaysThisInstance or AlwaysThisType.
Sourcepub fn result(&self) -> SelectorMatchResult
pub fn result(&self) -> SelectorMatchResult
The result of the selector match.
Sourcepub fn activator(&self) -> Option<&Rc<dyn IStyleActivator>>
pub fn activator(&self) -> Option<&Rc<dyn IStyleActivator>>
An activator which tracks the selector match, in the case of selectors that can change over time.
Sourcepub fn and(self, other: SelectorMatch) -> SelectorMatch
pub fn and(self, other: SelectorMatch) -> SelectorMatch
Logical-AND the selector match with another.
Trait Implementations§
Source§impl Clone for SelectorMatch
impl Clone for SelectorMatch
Source§impl Debug for SelectorMatch
impl Debug for SelectorMatch
Auto Trait Implementations§
impl !RefUnwindSafe for SelectorMatch
impl !Send for SelectorMatch
impl !Sync for SelectorMatch
impl !UnwindSafe for SelectorMatch
impl Freeze for SelectorMatch
impl Unpin for SelectorMatch
impl UnsafeUnpin for SelectorMatch
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more