# RedirectVisual

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

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

```rust
struct RedirectVisual
```

A visual that shows the subtree of another visual in its own place
(WinUI `Microsoft.UI.Composition.RedirectVisual`): the source keeps
rendering where it is, and the redirect visual draws the content and the
children of the source again, in its own coordinates, under its own
children.

The source is drawn as a [`CompositionVisualSurface`](/docs/0.5.0/api/ferroui-base/rendering/composition/struct-compositionvisualsurface/) draws it: its
content and children with their transforms, clips and opacities, the
visibility, opacity, transform and clip of the source itself ignored.
A redirect visual follows the changes of the source subtree while the
source is attached to a composition target. A redirect visual inside the
subtree of its own source draws nothing (it would contain itself).

Like a sprite visual, a redirect visual does not clip to its bounds when
it is created (`clip_to_bounds` is `false`).

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

## Members

- [`from_visual`](#function-from_visual)
- [`visual`](#function-visual)
- [`source`](#function-source)
- [`set_source`](#function-set_source)

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

### from_visual

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

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

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

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

### visual

```rust
fn visual(self: &Self) -> &Rc<CompositionVisual>
```

The visual as a composition visual.

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

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

### source

```rust
fn source(self: &Self) -> Option<Rc<CompositionVisual>>
```

The visual whose subtree the redirect visual shows.

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

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

### set_source

```rust
fn set_source(self: &Self, value: Option<Rc<CompositionVisual>>)
```



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

## 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/).
