# Style

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

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

```rust
struct Style
```

Defines a style.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`with_selector`](#function-with_selector)
- [`with_selector_fn`](#function-with_selector_fn)
- [`selector`](#function-selector)
- [`set_selector`](#function-set_selector)
- [`with_setters`](#function-with_setters)

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

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

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

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<Style>
```

Returns a strong reference to this object.

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

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

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `FerroObject::construct`.

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

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

### new

```rust
fn new() -> Ref<Self>
```

Creates a style without a selector.

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

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

### with_selector

```rust
fn with_selector(selector: Selector) -> Ref<Self>
```

Creates a style with a selector.

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

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

### with_selector_fn

```rust
fn with_selector_fn(selector: impl FnOnce(Option<Selector>) -> Selector) -> Ref<Self>
```

Creates a style whose selector is built by `selector`.

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

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

### selector

```rust
fn selector(self: &Self) -> Option<Selector>
```

The style's selector.

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

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

### set_selector

```rust
fn set_selector(self: &Self, value: Option<Selector>)
```



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

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

### with_setters

```rust
fn with_setters(selector: Selector, setters: impl IntoIterator<Item = Rc<Setter>>) -> Ref<Self>
```

Creates a style with a selector and setters.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`StyleBaseImplExt`](/docs/0.5.0/api/ferroui-base/styling/trait-stylebaseimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<Style>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`StyleBaseImpl`](/docs/0.5.0/api/ferroui-base/styling/trait-stylebaseimpl/)

## Availability

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