# CompositionCustomVisual

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

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

```rust
struct CompositionCustomVisual
```

A container visual that draws through a handler on the render thread.

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

## Members

- [`from_visual`](#function-from_visual)
- [`send_handler_message`](#function-send_handler_message)

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

### from_visual

```rust
fn from_visual(visual: &Rc<CompositionVisual>) -> Option<CompositionCustomVisual>
```

The handle of `visual` as a custom visual, if it is one.

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

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

### send_handler_message

```rust
fn send_handler_message(self: &Self, message: std::sync::Arc<dyn Any + Send + Sync>)
```

Sends a message to the handler, which receives it on the render
thread with the next commit.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Deref`

## Availability

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