# StyleChildren

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/styling/struct-stylechildren/

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

```rust
struct StyleChildren
```

The collection of child styles of a style.

The value is a shared handle: clones refer to the same collection, and
handles compare by identity.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/style_children.rs#L11)

## Members

- [`count`](#function-count)
- [`is_empty`](#function-is_empty)
- [`get`](#function-get)
- [`snapshot`](#function-snapshot)
- [`add`](#function-add)
- [`insert`](#function-insert)
- [`remove_at`](#function-remove_at)
- [`remove`](#function-remove)
- [`set`](#function-set)
- [`clear`](#function-clear)

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

### count

```rust
fn count(self: &Self) -> usize
```

The number of child styles.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/style_children.rs#L57)

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

### is_empty

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/style_children.rs#L62)

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

### get

```rust
fn get(self: &Self, index: usize) -> Rc<dyn IStyle>
```

The child style at `index`. Panics if out of range.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/style_children.rs#L67)

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

### snapshot

```rust
fn snapshot(self: &Self) -> Rc<Vec<Rc<dyn IStyle>>>
```

A snapshot of the child styles.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/style_children.rs#L73)

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

### add

```rust
fn add(self: &Self, item: impl Into<Rc<dyn IStyle>>)
```

Adds a child style.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/style_children.rs#L87)

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

### insert

```rust
fn insert(self: &Self, index: usize, item: impl Into<Rc<dyn IStyle>>)
```

Inserts a child style.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/style_children.rs#L92)

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

### remove_at

```rust
fn remove_at(self: &Self, index: usize)
```

Removes the child style at `index`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/style_children.rs#L104)

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

### remove

```rust
fn remove(self: &Self, item: impl Into<Rc<dyn IStyle>>) -> bool
```

Removes a child style. Returns whether it was present.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/style_children.rs#L120)

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

### set

```rust
fn set(self: &Self, index: usize, item: impl Into<Rc<dyn IStyle>>)
```

Replaces the child style at `index`.

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

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

### clear

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

Removes all child styles.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/style_children.rs#L151)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `PartialEq`
- `Debug`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)
- [`ValueTypeRegistration`](/docs/0.5.0/api/ferroui-base/data/core/trait-valuetyperegistration/)

## Availability

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