# PreviewEnvironmentEditor

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-designer/struct-previewenvironmenteditor/

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

```rust
struct PreviewEnvironmentEditor
```

The host retains this object while its control is visible. Callbacks are weak and do not
make control/host cycles; applying validates the complete draft before notifying the host.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/preview_environment.rs#L117)

## Members

- [`new`](#function-new)
- [`control`](#function-control)
- [`set_design_size_hint`](#function-set_design_size_hint)
- [`value`](#function-value)
- [`on_apply`](#function-on_apply)
- [`on_cancel`](#function-on_cancel)
- [`apply`](#function-apply)
- [`cancel`](#function-cancel)
- [`retire`](#function-retire)

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

### new

```rust
fn new(initial: PreviewEnvironment) -> Rc<Self>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/preview_environment.rs#L132)

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

### control

```rust
fn control(self: &Self) -> Ref<Control>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/preview_environment.rs#L282)

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

### set_design_size_hint

```rust
fn set_design_size_hint(self: &Self, width: Option<f64>, height: Option<f64>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/preview_environment.rs#L285)

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

### value

```rust
fn value(self: &Self) -> Result<PreviewEnvironment, String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/preview_environment.rs#L293)

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

### on_apply

```rust
fn on_apply(self: &Self, callback: impl Fn(PreviewEnvironment) -> Result<(), String> + 'static)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/preview_environment.rs#L323)

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

### on_cancel

```rust
fn on_cancel(self: &Self, callback: impl Fn() -> () + 'static)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/preview_environment.rs#L326)

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

### apply

```rust
fn apply(self: &Self) -> Result<(), String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/preview_environment.rs#L329)

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

### cancel

```rust
fn cancel(self: &Self)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/preview_environment.rs#L346)

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

### retire

```rust
fn retire(self: &Self)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/preview_environment.rs#L353)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Same`

## Availability

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