# LayoutContext

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-designer-tools/struct-layoutcontext/

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

```rust
struct LayoutContext<'a>
```

Bounds and resolved slots use one common coordinate space. Grid boundaries use panel-local units.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Tools/layout.rs#L141)

## Members

- [`document`](#struct_field-document)
- [`bounds`](#struct_field-bounds)
- [`new`](#function-new)
- [`with_grid_lines`](#function-with_grid_lines)
- [`with_resolved_layout`](#function-with_resolved_layout)
- [`with_resolved_properties`](#function-with_resolved_properties)
- [`property`](#function-property)
- [`children`](#function-children)
- [`content_container`](#function-content_container)
- [`resolved_layout`](#function-resolved_layout)
- [`is_visible`](#function-is_visible)
- [`grid_boundaries`](#function-grid_boundaries)
- [`bounds`](#function-bounds)

<a id="struct_field-document"></a>

### document

```rust
document: &'a ferroui_designer_core::Document
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Tools/layout.rs#L142)

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

### bounds

```rust
bounds: &'a std::collections::BTreeMap<ferroui_designer_core::NodeId, crate::Rect>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Tools/layout.rs#L143)

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

### new

```rust
fn new(document: &'a Document, bounds: &'a BTreeMap<NodeId, Rect>) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Tools/layout.rs#L149)

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

### with_grid_lines

```rust
fn with_grid_lines(self: Self, lines: &'a BTreeMap<NodeId, GridLines>) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Tools/layout.rs#L158)

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

### with_resolved_layout

```rust
fn with_resolved_layout(self: Self, layout: &'a BTreeMap<NodeId, ResolvedLayout>) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Tools/layout.rs#L162)

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

### with_resolved_properties

```rust
fn with_resolved_properties(self: Self, values: &'a BTreeMap<NodeId, BTreeMap<String, String>>) -> Self
```

Effective runtime values used to interpret panel layout, including styles and bindings.
These values never replace authored expressions when an operation writes a property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Tools/layout.rs#L168)

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

### property

```rust
fn property(self: &Self, node: NodeId, name: &str) -> Option<&str>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Tools/layout.rs#L175)

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

### children

```rust
fn children(self: &Self, panel: NodeId) -> Result<Vec<NodeId>>
```

The authored children, preserving their source order and explicit content slot.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Tools/layout.rs#L193)

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

### content_container

```rust
fn content_container(self: &Self, panel: NodeId) -> Result<NodeId>
```

The AST owner of the panel's content, including explicit Children/Content/Child elements.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Tools/layout.rs#L197)

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

### resolved_layout

```rust
fn resolved_layout(self: &Self, node: NodeId) -> Result<ResolvedLayout>
```

Resolved allocation before margin/alignment/render transforms, if supplied by the host.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Tools/layout.rs#L201)

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

### is_visible

```rust
fn is_visible(self: &Self, node: NodeId) -> Result<bool>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Tools/layout.rs#L204)

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

### grid_boundaries

```rust
fn grid_boundaries(self: &Self, panel: NodeId) -> Result<GridLines>
```

Actual Grid track boundaries. A portable fallback resolves unconstrained pixel/star tracks.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Tools/layout.rs#L208)

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

### bounds

```rust
fn bounds(self: &Self, node: NodeId) -> Result<Rect>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Tools/layout.rs#L237)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`

## Availability

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