# DashStyle

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/struct-dashstyle/

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

```rust
struct DashStyle
```

Represents the sequence of dashes and gaps that will be applied by a
`Pen`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/dash_style.rs#L16)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`dashes_property`](#function-dashes_property)
- [`offset_property`](#function-offset_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`with_dashes`](#function-with_dashes)
- [`with_dash_list`](#function-with_dash_list)
- [`dash`](#function-dash)
- [`dot`](#function-dot)
- [`dash_dot`](#function-dash_dot)
- [`dash_dot_dot`](#function-dash_dot_dot)
- [`dashes`](#function-dashes)
- [`set_dashes`](#function-set_dashes)
- [`offset`](#function-offset)
- [`set_offset`](#function-set_offset)
- [`invalidated`](#function-invalidated)
- [`to_immutable`](#function-to_immutable)

<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/media/dash_style.rs#L22)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### dashes_property

```rust
fn dashes_property() -> &'static StyledProperty<Option<MediaCollection<f64>>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/dash_style.rs#L49)

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

### offset_property

```rust
fn offset_property() -> &'static StyledProperty<f64>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/dash_style.rs#L49)

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

### construct

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

Creates the class data.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/dash_style.rs#L66)

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

### new

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

Creates a dash style without dashes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/dash_style.rs#L71)

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

### with_dashes

```rust
fn with_dashes(dashes: Option<&[f64]>, offset: f64) -> Ref<Self>
```

Creates a dash style with a copy of the given dashes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/dash_style.rs#L76)

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

### with_dash_list

```rust
fn with_dash_list(dashes: MediaCollection<f64>, offset: f64) -> Ref<Self>
```

Creates a dash style that shares the given dash list.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/dash_style.rs#L81)

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

### dash

```rust
fn dash() -> Rc<ImmutableDashStyle>
```

Represents a dashed dash style.

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

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

### dot

```rust
fn dot() -> Rc<ImmutableDashStyle>
```

Represents a dotted dash style.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/dash_style.rs#L97)

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

### dash_dot

```rust
fn dash_dot() -> Rc<ImmutableDashStyle>
```

Represents a dashed dotted dash style.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/dash_style.rs#L105)

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

### dash_dot_dot

```rust
fn dash_dot_dot() -> Rc<ImmutableDashStyle>
```

Represents a dashed double dotted dash style.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/dash_style.rs#L114)

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

### dashes

```rust
fn dashes(self: &Self) -> Option<MediaCollection<f64>>
```

The length of alternating dashes and gaps.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/dash_style.rs#L123)

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

### set_dashes

```rust
fn set_dashes(self: &Self, value: Option<MediaCollection<f64>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/dash_style.rs#L127)

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

### offset

```rust
fn offset(self: &Self) -> f64
```

How far in the dash sequence the stroke will start.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/dash_style.rs#L132)

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

### set_offset

```rust
fn set_offset(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/dash_style.rs#L136)

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

### invalidated

```rust
fn invalidated(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
```

Subscribes to invalidation of the dash style: raised when the dashes
or the offset change. Dropping the returned guard removes the handler;
`Subscription::detach` keeps it for the life of the dash style.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/dash_style.rs#L143)

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

### to_immutable

```rust
fn to_immutable(self: &Self) -> ImmutableDashStyle
```

Returns an immutable clone of the dash style.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/dash_style.rs#L163)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`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<DashStyle>`](/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/)

## Availability

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