# CompositionEffectFactory

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

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

```rust
struct CompositionEffectFactory
```

Creates the brushes of one effect graph (WinUI
`Microsoft.UI.Composition.CompositionEffectFactory`), made by
`Compositor::create_effect_factory`.

The graph is checked when the factory is made: `load_status`
is `Success` when the brushes can draw it. A factory whose effect cannot
be loaded still makes brushes, which draw nothing.

Deviation (winui-composition.md): WinUI throws from `CreateEffectFactory`
for an effect it cannot load; here the factory is made and reports the
failure through its load status and extended error. The factory is not a
composition object (no `Properties`, no animations).

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

## Members

- [`compositor`](#function-compositor)
- [`create_brush`](#function-create_brush)
- [`load_status`](#function-load_status)
- [`extended_error`](#function-extended_error)

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

### compositor

```rust
fn compositor(self: &Self) -> &Rc<Compositor>
```

The compositor of the factory.

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

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

### create_brush

```rust
fn create_brush(self: &Self) -> CompositionEffectBrush
```

`CreateBrush`: a brush that draws the effect. Its source parameters
are bound with
`set_source_parameter`;
its animatable properties are entries of its `Properties`, set to the
values of the description.

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

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

### load_status

```rust
fn load_status(self: &Self) -> CompositionEffectFactoryLoadStatus
```

`LoadStatus`: whether the effect was loaded.

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

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

### extended_error

```rust
fn extended_error(self: &Self) -> Option<&CompositionEffectFactoryError>
```

`ExtendedError`: why the effect was not loaded; `None` when it was.

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

## Trait implementations

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

## Availability

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