# CompositionScopedBatch

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

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

```rust
struct CompositionScopedBatch
```

An explicitly created group of active animations or effects (WinUI
`CompositionScopedBatch`).

Every key frame animation started while the batch is active (created and
neither suspended nor ended) belongs to it, also the animations of a
group and implicit animations. Once `end` has been called
and all its animations are over, the batch raises
`completed` on the thread of its compositor.

Several batches may be active at once; an animation belongs to each of
them.

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

## Members

- [`compositor`](#function-compositor)
- [`is_active`](#function-is_active)
- [`is_ended`](#function-is_ended)
- [`end`](#function-end)
- [`suspend`](#function-suspend)
- [`resume`](#function-resume)
- [`completed`](#function-completed)

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

### compositor

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

The associated compositor.

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

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

### is_active

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

Whether the batch is open for animations to be aggregated: false
once it is suspended or ended.

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

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

### is_ended

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

Whether the batch has been closed and can no longer accept changes.

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

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

### end

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

Closes the batch. Once closed it cannot be suspended or resumed
again. `Completed` is raised once all the animations of the batch are
over, right away (asynchronously) when there are none. Ending a batch
again does nothing.

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

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

### suspend

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

Suspends aggregating animations in the batch until
`resume`. Panics when the batch is ended (WinUI
throws).

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

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

### resume

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

Resumes aggregating animations in the batch. Panics when the batch
is ended (WinUI throws).

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

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

### completed

```rust
fn completed(self: &Self, handler: impl Fn(&CompositionBatchCompletedEventArgs) -> () + 'static) -> Subscription
```

Raised once all animations of the ended batch have completed.
Dropping the returned guard removes the handler;
`Subscription::detach` keeps it for the life of the batch.

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

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

## Availability

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