# CompositionPath

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

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

```rust
struct CompositionPath
```

The path of a [`CompositionPathGeometry`](/docs/0.5.0/api/ferroui-base/rendering/composition/struct-compositionpathgeometry/) (WinUI
`Microsoft.UI.Composition.CompositionPath`): an immutable platform
geometry, made from a FerroUI [`Geometry`](/docs/0.5.0/api/ferroui-base/media/struct-geometry/) (a `StreamGeometry`, a
`PathGeometry`, ...) or from a string of path data.

Deviation (winui-composition.md): WinUI makes a path from an
`IGeometrySource2D` (a Win2D geometry); here the source is a FerroUI
geometry, and the path keeps the platform geometry it had when the path
was made.

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

## Members

- [`from_geometry`](#function-from_geometry)
- [`parse`](#function-parse)
- [`bounds`](#function-bounds)

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

### from_geometry

```rust
fn from_geometry(geometry: &Geometry) -> Option<CompositionPath>
```

The path of `geometry`, as it is now; `None` when the geometry has no
platform geometry.

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

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

### parse

```rust
fn parse(data: &str) -> Result<CompositionPath, FormatError>
```

The path described by a string of path data (the mini-language of
`Geometry::parse`).

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

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

### bounds

```rust
fn bounds(self: &Self) -> Rect
```

The bounds of the path.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`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`
- `Debug`

## Availability

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