# ElementManager

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls-repeater/layouts/struct-elementmanager/

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

```rust
struct ElementManager
```

A contiguous realized range with lazy sentinels for collection insertions.
Per-element bounds stay independent of the final line alignment.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L19)

## Members

- [`new`](#function-new)
- [`set_context`](#function-set_context)
- [`on_begin_measure`](#function-on_begin_measure)
- [`first_realized_data_index`](#function-first_realized_data_index)
- [`realized_element_count`](#function-realized_element_count)
- [`data_index_from_range_index`](#function-data_index_from_range_index)
- [`range_index_from_data_index`](#function-range_index_from_data_index)
- [`is_index_valid_in_data`](#function-is_index_valid_in_data)
- [`is_data_index_realized`](#function-is_data_index_realized)
- [`get_at`](#function-get_at)
- [`get_realized_element`](#function-get_realized_element)
- [`get_element_if_realized`](#function-get_element_if_realized)
- [`add`](#function-add)
- [`insert`](#function-insert)
- [`ensure_element_realized`](#function-ensure_element_realized)
- [`clear_realized_range`](#function-clear_realized_range)
- [`clear_range`](#function-clear_range)
- [`discard_elements_outside_window`](#function-discard_elements_outside_window)
- [`layout_bounds_for_data_index`](#function-layout_bounds_for_data_index)
- [`set_layout_bounds_for_data_index`](#function-set_layout_bounds_for_data_index)
- [`layout_bounds_for_range_index`](#function-layout_bounds_for_range_index)
- [`set_layout_bounds_for_range_index`](#function-set_layout_bounds_for_range_index)
- [`is_layout_bounds_set`](#function-is_layout_bounds_set)
- [`is_window_connected`](#function-is_window_connected)
- [`data_source_changed`](#function-data_source_changed)

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

### new

```rust
fn new() -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L31)

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

### set_context

```rust
fn set_context(self: &Self, context: &Ref<VirtualizingLayoutContext>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L39)

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

### on_begin_measure

```rust
fn on_begin_measure(self: &Self, orientation: ScrollOrientation)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L52)

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

### first_realized_data_index

```rust
fn first_realized_data_index(self: &Self) -> i32
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L61)

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

### realized_element_count

```rust
fn realized_element_count(self: &Self) -> i32
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L68)

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

### data_index_from_range_index

```rust
fn data_index_from_range_index(self: &Self, index: i32) -> i32
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L75)

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

### range_index_from_data_index

```rust
fn range_index_from_data_index(self: &Self, index: i32) -> i32
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L82)

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

### is_index_valid_in_data

```rust
fn is_index_valid_in_data(self: &Self, index: i32) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L89)

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

### is_data_index_realized

```rust
fn is_data_index_realized(self: &Self, index: i32) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L92)

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

### get_at

```rust
fn get_at(self: &Self, range_index: i32) -> Ref<Control>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L97)

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

### get_realized_element

```rust
fn get_realized_element(self: &Self, index: i32) -> Ref<Control>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L114)

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

### get_element_if_realized

```rust
fn get_element_if_realized(self: &Self, index: i32) -> Option<Ref<Control>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L117)

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

### add

```rust
fn add(self: &Self, element: Ref<Control>, index: i32)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L121)

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

### insert

```rust
fn insert(self: &Self, range_index: i32, data_index: i32, element: Option<Ref<Control>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L128)

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

### ensure_element_realized

```rust
fn ensure_element_realized(self: &Self, forward: bool, index: i32)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L139)

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

### clear_realized_range

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L151)

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

### clear_range

```rust
fn clear_range(self: &Self, start: i32, count: i32)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L158)

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

### discard_elements_outside_window

```rust
fn discard_elements_outside_window(self: &Self, forward: bool, start_index: i32)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L191)

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

### layout_bounds_for_data_index

```rust
fn layout_bounds_for_data_index(self: &Self, index: i32) -> Rect
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L201)

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

### set_layout_bounds_for_data_index

```rust
fn set_layout_bounds_for_data_index(self: &Self, index: i32, bounds: Rect)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L204)

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

### layout_bounds_for_range_index

```rust
fn layout_bounds_for_range_index(self: &Self, index: i32) -> Rect
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L207)

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

### set_layout_bounds_for_range_index

```rust
fn set_layout_bounds_for_range_index(self: &Self, index: i32, bounds: Rect)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L210)

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

### is_layout_bounds_set

```rust
fn is_layout_bounds_set(self: &Self, index: i32) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L217)

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

### is_window_connected

```rust
fn is_window_connected(self: &Self, window: Rect, orientation: ScrollOrientation, scroll_same_as_flow: bool) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L220)

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

### data_source_changed

```rust
fn data_source_changed(self: &Self, args: &ItemsChangedEventArgs<'_>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/element_manager.rs#L268)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Default`

## Availability

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