# ICompositionImportableSharedGpuContextImage

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/rendering/composition/trait-icompositionimportablesharedgpucontextimage/

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

```rust
trait ICompositionImportableSharedGpuContextImage: Send + Sync
```

An GPU image descriptor obtained from a context from the same share group as one used by the compositor

The image is shared between two threads, as upstream, where that is a
convention: the thread of the caller makes it, keeps it and disposes it,
and the thread that renders reads it during the import and may dispose it
with the imported image. Here the type says so: what both threads read
is a plain value or is behind a lock, and what belongs to the context of
the caller (the context itself) is bound to its thread inside the
implementation and is not touched from the other one.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_external_memory.rs#L150)

## Members

- [`dispose`](#function-dispose)
- [`as_any`](#function-as_any)

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

### dispose

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

Releases the image. Either thread may call it, more than once.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_external_memory.rs#L152)

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

### as_any

```rust
fn as_any(self: &Self) -> &dyn std::any::Any
```

Lets the backend that made the image recover its concrete type (the
cast upstream performs on the image it is asked to import).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_external_memory.rs#L156)

## Availability

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