# BoxShadows

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/struct-boxshadows/

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

```rust
struct BoxShadows
```

Represents a collection of [`BoxShadow`](/docs/0.5.0/api/ferroui-base/media/struct-boxshadow/)s.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/box_shadows.rs#L15)

## Members

- [`new`](#function-new)
- [`with_rest`](#function-with_rest)
- [`count`](#function-count)
- [`get`](#function-get)
- [`iter`](#function-iter)
- [`parse`](#function-parse)
- [`transform_bounds`](#function-transform_bounds)
- [`has_inset_shadows`](#function-has_inset_shadows)

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

### new

```rust
fn new(shadow: BoxShadow) -> Self
```

Creates a collection containing a single shadow. A default shadow
produces an empty collection.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/box_shadows.rs#L24)

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

### with_rest

```rust
fn with_rest(first: BoxShadow, rest: &[BoxShadow]) -> Self
```

Creates a collection containing `first` followed by `rest`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/box_shadows.rs#L29)

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

### count

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

The number of shadows in the collection.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/box_shadows.rs#L35)

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

### get

```rust
fn get(self: &Self, index: usize) -> BoxShadow
```

The shadow at `index`. Panics if the index is out of range.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/box_shadows.rs#L40)

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

### iter

```rust
fn iter(self: &Self) -> impl Iterator<Item = BoxShadow> + '_
```

Iterates over the shadows.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/box_shadows.rs#L51)

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

### parse

```rust
fn parse(s: &str) -> Result<BoxShadows, FormatError>
```

Parses a comma separated list of box shadows.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/box_shadows.rs#L56)

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

### transform_bounds

```rust
fn transform_bounds(self: &Self, rect: Rect) -> Rect
```

Transforms the specified bounding rectangle to account for every
shadow in the collection.

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

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

### has_inset_shadows

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

Whether the collection contains an inset shadow.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/box_shadows.rs#L91)

## 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`
- `ToString`
- `ErasedDestructor`
- `IntoEither`
- [`Transition<BoxShadows>`](/docs/0.5.0/api/ferroui-base/animation/trait-transition/)
- `Clone`
- `Debug`
- `Default`
- `PartialEq`
- `FromStr`
- `Display`
- [`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/).
