# Size3D

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-media3d/struct-size3d/

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

```rust
struct Size3D
```

The extent of a box in 3D space, with double-precision dimensions (WPF's
`System.Windows.Media.Media3D.Size3D`).

A dimension is never negative, except in `Size3D::EMPTY`, the size of no box, whose dimensions
are negative infinity. The members that WPF guards with exceptions return a [`Size3DError`](/docs/0.5.0/api/ferroui-media3d/enum-size3derror/).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/size_3d.rs#L17)

## Members

- [`EMPTY`](#assoc_const-empty)
- [`new`](#function-new)
- [`is_empty`](#function-is_empty)
- [`x`](#function-x)
- [`y`](#function-y)
- [`z`](#function-z)
- [`set_x`](#function-set_x)
- [`set_y`](#function-set_y)
- [`set_z`](#function-set_z)
- [`parse`](#function-parse)

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

### EMPTY

```rust
const EMPTY: Size3D
```

The size of no box (WPF's `Size3D.Empty`): every dimension negative infinity.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/size_3d.rs#L25)

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

### new

```rust
fn new(x: f64, y: f64, z: f64) -> Result<Self, Size3DError>
```

A size with the given dimensions; `Size3DError::NegativeDimension` when one is negative.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/size_3d.rs#L32)

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

### is_empty

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

Whether this is `Size3D::EMPTY`.

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

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

### x

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

The extent along the X axis.

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

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

### y

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

The extent along the Y axis.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/size_3d.rs#L63)

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

### z

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

The extent along the Z axis.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/size_3d.rs#L69)

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

### set_x

```rust
fn set_x(self: &mut Self, value: f64) -> Result<(), Size3DError>
```

Sets the extent along the X axis.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/size_3d.rs#L74)

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

### set_y

```rust
fn set_y(self: &mut Self, value: f64) -> Result<(), Size3DError>
```

Sets the extent along the Y axis.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/size_3d.rs#L80)

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

### set_z

```rust
fn set_z(self: &mut Self, value: f64) -> Result<(), Size3DError>
```

Sets the extent along the Z axis.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/size_3d.rs#L86)

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

### parse

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

Parses the text form: `"Empty"`, or `"x,y,z"` (commas, white space or both between the
numbers) in the invariant culture, none of them negative.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/size_3d.rs#L105)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ToString`
- [`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/)
- `ErasedDestructor`
- `IntoEither`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)
- `Clone`
- `Copy`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Default`
- `From<Size3D>`
- `FromStr`
- `Display`
- `From<Vector3D>`

## Availability

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