# Thickness

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

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

```rust
struct Thickness
```

Describes the thickness of a frame around a rectangle.

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

## Members

- [`left`](#struct_field-left)
- [`top`](#struct_field-top)
- [`right`](#struct_field-right)
- [`bottom`](#struct_field-bottom)
- [`new`](#function-new)
- [`uniform`](#function-uniform)
- [`symmetric`](#function-symmetric)
- [`is_uniform`](#function-is_uniform)
- [`parse`](#function-parse)
- [`equals`](#function-equals)
- [`deconstruct`](#function-deconstruct)

<a id="struct_field-left"></a>

### left

```rust
left: f64
```

The thickness on the left.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/thickness.rs#L16)

<a id="struct_field-top"></a>

### top

```rust
top: f64
```

The thickness on the top.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/thickness.rs#L18)

<a id="struct_field-right"></a>

### right

```rust
right: f64
```

The thickness on the right.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/thickness.rs#L20)

<a id="struct_field-bottom"></a>

### bottom

```rust
bottom: f64
```

The thickness on the bottom.

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

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

### new

```rust
const fn new(left: f64, top: f64, right: f64, bottom: f64) -> Self
```

Initializes a new instance of the `Thickness` structure from the four sides.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/thickness.rs#L28)

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

### uniform

```rust
const fn uniform(uniform_length: f64) -> Self
```

Initializes a `Thickness` with the same length on every side.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/thickness.rs#L39)

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

### symmetric

```rust
const fn symmetric(horizontal: f64, vertical: f64) -> Self
```

Initializes a `Thickness` from the thickness on the left and right, and
the thickness on the top and bottom.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/thickness.rs#L51)

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

### is_uniform

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

Gets a value indicating whether all sides are equal (NaN compares equal to NaN here).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/thickness.rs#L57)

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

### parse

```rust
fn parse(s: &str) -> Result<Self, FormatError>
```

Parses a `Thickness` string: one, two or four numbers.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/thickness.rs#L64)

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

### equals

```rust
fn equals(self: &Self, other: Thickness) -> bool
```

Returns a boolean indicating whether the thickness is equal to the other
given thickness (exact comparison of the sides).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/thickness.rs#L87)

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

### deconstruct

```rust
const fn deconstruct(self: &Self) -> (f64, f64, f64, f64)
```

Deconstructs the thickness into its left, top, right and bottom values.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/thickness.rs#L96)

## 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`
- [`Transition<Thickness>`](/docs/0.5.0/api/ferroui-base/animation/trait-transition/)
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)
- [`ValueTypeRegistration`](/docs/0.5.0/api/ferroui-base/data/core/trait-valuetyperegistration/)
- `Clone`
- `Copy`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Default`
- `From<Thickness>`
- `Add`
- `Sub`
- `Mul<f64>`
- `Add<Thickness>`
- `Sub<Thickness>`
- `AddAssign`
- `SubAssign`
- `MulAssign<f64>`
- `AddAssign<Thickness>`
- `SubAssign<Thickness>`
- `FromStr`
- `Display`

## Availability

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