# CompositionPropertySet

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

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

```rust
struct CompositionPropertySet
```

Property sets are composition objects that allow storage of key values pairs
that can be shared across the application and are not tied to the lifetime of another composition object.
Property sets are most commonly used with animations, where they maintain key-value pairs
that are referenced to drive portions of composition animations. Property sets
provide the ability to insert key-value pairs or retrieve a value for a given key.
A property set does not support a delete function – ensure you use property sets
to store values that will be shared across the application.

A property set made with `new` (or `Compositor::create_property_set`) is live,
as in WinUI: it has a server counterpart that receives its entries with each batch, its
entries can be animated with `start_animation`, and an expression that refers to it reads
its current values. Upstream's property sets live on the UI thread only, and an expression
sees a copy of them taken when its animation starts; the parameters of an animation are such
a set (see `docs/porting/winui-composition.md`).

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

## Members

- [`new`](#function-new)
- [`is_live`](#function-is_live)
- [`compositor`](#function-compositor)
- [`insert_color`](#function-insert_color)
- [`insert_matrix3x2`](#function-insert_matrix3x2)
- [`insert_matrix4x4`](#function-insert_matrix4x4)
- [`insert_quaternion`](#function-insert_quaternion)
- [`insert_scalar`](#function-insert_scalar)
- [`insert_vector2`](#function-insert_vector2)
- [`insert_vector3`](#function-insert_vector3)
- [`insert_vector4`](#function-insert_vector4)
- [`try_get_color`](#function-try_get_color)
- [`try_get_matrix3x2`](#function-try_get_matrix3x2)
- [`try_get_matrix4x4`](#function-try_get_matrix4x4)
- [`try_get_quaternion`](#function-try_get_quaternion)
- [`try_get_scalar`](#function-try_get_scalar)
- [`try_get_vector2`](#function-try_get_vector2)
- [`try_get_vector3`](#function-try_get_vector3)
- [`try_get_vector4`](#function-try_get_vector4)
- [`insert_boolean`](#function-insert_boolean)
- [`try_get_boolean`](#function-try_get_boolean)

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

### new

```rust
fn new(compositor: &Rc<Compositor>) -> Rc<CompositionPropertySet>
```

Creates a live property set (`Compositor.CreatePropertySet`).

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

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

### is_live

```rust
fn is_live(self: &Self) -> bool
```

Whether the set is live (has a server counterpart).

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

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

### compositor

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



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

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

### insert_color

```rust
fn insert_color(self: &Self, property_name: &str, value: Color)
```



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

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

### insert_matrix3x2

```rust
fn insert_matrix3x2(self: &Self, property_name: &str, value: Matrix3x2)
```



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

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

### insert_matrix4x4

```rust
fn insert_matrix4x4(self: &Self, property_name: &str, value: Matrix4x4)
```



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

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

### insert_quaternion

```rust
fn insert_quaternion(self: &Self, property_name: &str, value: Quaternion)
```



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

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

### insert_scalar

```rust
fn insert_scalar(self: &Self, property_name: &str, value: f32)
```



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

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

### insert_vector2

```rust
fn insert_vector2(self: &Self, property_name: &str, value: Vector2)
```



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

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

### insert_vector3

```rust
fn insert_vector3(self: &Self, property_name: &str, value: Vector3)
```



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

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

### insert_vector4

```rust
fn insert_vector4(self: &Self, property_name: &str, value: Vector4)
```



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

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

### try_get_color

```rust
fn try_get_color(self: &Self, property_name: &str) -> (CompositionGetValueStatus, Color)
```



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

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

### try_get_matrix3x2

```rust
fn try_get_matrix3x2(self: &Self, property_name: &str) -> (CompositionGetValueStatus, Matrix3x2)
```



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

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

### try_get_matrix4x4

```rust
fn try_get_matrix4x4(self: &Self, property_name: &str) -> (CompositionGetValueStatus, Matrix4x4)
```



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

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

### try_get_quaternion

```rust
fn try_get_quaternion(self: &Self, property_name: &str) -> (CompositionGetValueStatus, Quaternion)
```



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

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

### try_get_scalar

```rust
fn try_get_scalar(self: &Self, property_name: &str) -> (CompositionGetValueStatus, f32)
```



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

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

### try_get_vector2

```rust
fn try_get_vector2(self: &Self, property_name: &str) -> (CompositionGetValueStatus, Vector2)
```



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

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

### try_get_vector3

```rust
fn try_get_vector3(self: &Self, property_name: &str) -> (CompositionGetValueStatus, Vector3)
```



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

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

### try_get_vector4

```rust
fn try_get_vector4(self: &Self, property_name: &str) -> (CompositionGetValueStatus, Vector4)
```



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

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

### insert_boolean

```rust
fn insert_boolean(self: &Self, property_name: &str, value: bool)
```



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

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

### try_get_boolean

```rust
fn try_get_boolean(self: &Self, property_name: &str) -> (CompositionGetValueStatus, bool)
```



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

## 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`
- [`AsCompositionObject`](/docs/0.5.0/api/ferroui-base/rendering/composition/trait-ascompositionobject/)
- `ICompositorSerializable`
- [`ICompositionObjectAnimations`](/docs/0.5.0/api/ferroui-base/rendering/composition/trait-icompositionobjectanimations/)

## Availability

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