# SelectorMatch

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/styling/struct-selectormatch/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct SelectorMatch
```

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.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/selector_match.rs#L27)

## Members

- [`NEVER_THIS_TYPE`](#assoc_const-never_this_type)
- [`NEVER_THIS_INSTANCE`](#assoc_const-never_this_instance)
- [`ALWAYS_THIS_TYPE`](#assoc_const-always_this_type)
- [`ALWAYS_THIS_INSTANCE`](#assoc_const-always_this_instance)
- [`sometimes`](#function-sometimes)
- [`new`](#function-new)
- [`is_match`](#function-is_match)
- [`result`](#function-result)
- [`activator`](#function-activator)
- [`and`](#function-and)

<a id="assoc_const-never_this_type"></a>

### NEVER_THIS_TYPE

```rust
const NEVER_THIS_TYPE: SelectorMatch
```

A selector match with the result of `SelectorMatchResult::NeverThisType`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/selector_match.rs#L34)

<a id="assoc_const-never_this_instance"></a>

### NEVER_THIS_INSTANCE

```rust
const NEVER_THIS_INSTANCE: SelectorMatch
```

A selector match with the result of `SelectorMatchResult::NeverThisInstance`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/selector_match.rs#L37)

<a id="assoc_const-always_this_type"></a>

### ALWAYS_THIS_TYPE

```rust
const ALWAYS_THIS_TYPE: SelectorMatch
```

A selector match with the result of `SelectorMatchResult::AlwaysThisType`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/selector_match.rs#L40)

<a id="assoc_const-always_this_instance"></a>

### ALWAYS_THIS_INSTANCE

```rust
const ALWAYS_THIS_INSTANCE: SelectorMatch
```

A selector match with the result of `SelectorMatchResult::AlwaysThisInstance`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/selector_match.rs#L43)

<a id="function-sometimes"></a>

### sometimes

```rust
fn sometimes(activator: Rc<dyn IStyleActivator>) -> Self
```

Creates a match with a `SelectorMatchResult::Sometimes` result,
whose state is tracked by `activator`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/selector_match.rs#L47)

<a id="function-new"></a>

### new

```rust
const fn new(result: SelectorMatchResult) -> Self
```

Creates a match with the specified result and no activator.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/selector_match.rs#L52)

<a id="function-is_match"></a>

### is_match

```rust
fn is_match(self: &Self) -> bool
```

Whether the match was positive.

The match is positive if the result is `Sometimes`,
`AlwaysThisInstance` or `AlwaysThisType`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/selector_match.rs#L61)

<a id="function-result"></a>

### result

```rust
fn result(self: &Self) -> SelectorMatchResult
```

The result of the selector match.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/selector_match.rs#L67)

<a id="function-activator"></a>

### activator

```rust
fn activator(self: &Self) -> Option<&Rc<dyn IStyleActivator>>
```

An activator which tracks the selector match, in the case of
selectors that can change over time.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/selector_match.rs#L74)

<a id="function-and"></a>

### and

```rust
fn and(self: Self, other: SelectorMatch) -> SelectorMatch
```

Logical-AND the selector match with another.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/selector_match.rs#L83)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ToString`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Debug`
- `Display`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
