# CompositionObject

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

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

```rust
struct CompositionObject
```

The part every composition object embeds: what upstream's abstract
`CompositionObject` holds.

A class "derives" from `CompositionObject` by embedding this value,
implementing `ICompositorSerializable` through it, and forwarding the
animation members to the functions of this module.

The server-side counterpart is known by id. Disposing the object
disposes its counterpart with the next batch, which keeps it under its id
while this object is alive: upstream the UI-thread object holds its
server object, so jobs and animations that name it after the disposal
still reach it, and the id cannot be reused meanwhile. When the object is
dropped, its counterpart is disposed (if it was not) and released with a
later batch: this stands in for the garbage collector, which reclaims a
server object upstream once the UI-thread object is unreachable. A
counterpart that was disposed out of band (a composition target) is kept
and released the same way.

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

## Members

- [`properties`](#function-properties)
- [`comment`](#function-comment)
- [`set_comment`](#function-set_comment)
- [`implicit_animations`](#function-implicit_animations)
- [`set_implicit_animations`](#function-set_implicit_animations)
- [`compositor`](#function-compositor)
- [`is_disposed`](#function-is_disposed)
- [`dispose`](#function-dispose)
- [`begin_serialize_changes`](#function-begin_serialize_changes)

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

### properties

```rust
fn properties(self: &Self) -> Rc<CompositionPropertySet>
```

The property set of the object (WinUI `CompositionObject.Properties`):
a live property set that belongs to the object, for the values an
application keeps with it. Animations and expressions use it as any
property set (`set_reference_parameter("props", obj.properties())`,
then `props.Name`). Created when it is first asked for.

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

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

### comment

```rust
fn comment(self: &Self) -> String
```

A string the application associates with the object, for debugging
(WinUI `Comment`); empty by default.

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

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

### set_comment

```rust
fn set_comment(self: &Self, value: String)
```



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

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

### implicit_animations

```rust
fn implicit_animations(self: &Self) -> Option<Rc<ImplicitAnimationCollection>>
```

The collection of implicit animations attached to this object.

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

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

### set_implicit_animations

```rust
fn set_implicit_animations(self: &Self, value: Option<Rc<ImplicitAnimationCollection>>)
```



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

<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_object.rs#L164)

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

### is_disposed

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



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

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

### dispose

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



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

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

### begin_serialize_changes

```rust
fn begin_serialize_changes(self: &Self, c: &Compositor)
```

The head of `ICompositorSerializable.SerializeChanges`: the object
may be registered again from now on.

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

## 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`
- `Drop`

## Availability

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