# TexturePresenter

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-media-controls/struct-texturepresenter/

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

```rust
struct TexturePresenter
```



[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Controls/texture_presenter.rs#L34)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`stretch_property`](#function-stretch_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`stretch`](#function-stretch)
- [`set_stretch`](#function-set_stretch)
- [`errors`](#function-errors)
- [`frame_presented`](#function-frame_presented)
- [`frame_cleared`](#function-frame_cleared)
- [`presented_frame`](#function-presented_frame)
- [`last_error`](#function-last_error)
- [`set_frame_source`](#function-set_frame_source)
- [`invalidate_device`](#function-invalidate_device)
- [`present_latest`](#function-present_latest)

<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.Media.Controls/texture_presenter.rs#L52)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Controls/texture_presenter.rs#L52)

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

### stretch_property

```rust
fn stretch_property() -> &'static StyledProperty<Stretch>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Controls/texture_presenter.rs#L71)

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

### construct

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Controls/texture_presenter.rs#L85)

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

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Controls/texture_presenter.rs#L103)

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

### stretch

```rust
fn stretch(self: &Self) -> Stretch
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Controls/texture_presenter.rs#L106)

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

### set_stretch

```rust
fn set_stretch(self: &Self, value: Stretch)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Controls/texture_presenter.rs#L109)

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

### errors

```rust
fn errors(self: &Self) -> &MediaEvent<MediaError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Controls/texture_presenter.rs#L112)

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

### frame_presented

```rust
fn frame_presented(self: &Self) -> &MediaEvent<FrameMetadata>
```

Raised after the compositor accepts a current shared frame. This is a
presentation-state notification, not a GPU-completion fence.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Controls/texture_presenter.rs#L117)

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

### frame_cleared

```rust
fn frame_cleared(self: &Self) -> &MediaEvent<()>
```

Raised when presentation is reset or the current frame is removed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Controls/texture_presenter.rs#L121)

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

### presented_frame

```rust
fn presented_frame(self: &Self) -> Option<std::cell::Ref<'_, FrameMetadata>>
```

Metadata for the currently presented frame, with no pixel storage.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Controls/texture_presenter.rs#L125)

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

### last_error

```rust
fn last_error(self: &Self) -> Option<MediaError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Controls/texture_presenter.rs#L128)

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

### set_frame_source

```rust
fn set_frame_source(self: &Self, source: Option<Arc<FrameMailbox>>, importer: Option<Rc<dyn TextureFrameImporter>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Controls/texture_presenter.rs#L131)

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

### invalidate_device

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

Retire presentation on context loss while retaining the selected source.
A fresh provider/importer must be attached after the renderer recreates it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Controls/texture_presenter.rs#L185)

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

### present_latest

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

Called on a source frame/invalidation opportunity; unchanged paused
frames do not submit another import or render job.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Controls/texture_presenter.rs#L211)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `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`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<TexturePresenter>`](/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/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)

## Availability

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