# StyleQuery

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

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

```rust
struct StyleQuery
```

A query in a [`ContainerQuery`](/docs/0.5.0/api/ferroui-base/styling/struct-containerquery/).

Queries are built with the functions of `StyleQueries`
and the chaining methods of this type.

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

## Members

- [`width`](#function-width)
- [`height`](#function-height)
- [`match_`](#function-match_)
- [`to_string_with_owner`](#function-to_string_with_owner)

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

### width

```rust
fn width(self: Self, operator: StyleQueryComparisonOperator, value: f64) -> StyleQuery
```

Returns a query which additionally matches the width of the
container.

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

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

### height

```rust
fn height(self: Self, operator: StyleQueryComparisonOperator, value: f64) -> StyleQuery
```

Returns a query which additionally matches the height of the
container.

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

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

### match_

```rust
fn match_(self: &Self, control: &StyledElement, parent: Option<&StyleBase>, subscribe: bool, container_name: Option<&str>) -> SelectorMatch
```

Tries to match the query with a control.

`parent` is the parent container, if the container holding the query
is a nested container. With `subscribe`, a match whose state can
change over time carries an activator that tracks it; without, the
match is only evaluated for the current state. `container_name` is the
name of the container to query.

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

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

### to_string_with_owner

```rust
fn to_string_with_owner(self: &Self, owner: Option<&ContainerQuery>) -> String
```

Gets a string representing the query.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`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`
- `PartialEq`
- `Display`
- `Debug`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)

## Availability

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