# LogicalTextRunEnumerator

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

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

```rust
struct LogicalTextRunEnumerator<'a>
```

Walks the runs of a [`TextLine`](/docs/0.5.0/api/ferroui-base/media/text_formatting/trait-textline/) in **logical** (source-text) order. This
is the order that splits and length-based offsets are defined in, and is
what every `TextCollapsingProperties::collapse` implementation needs to
see — unlike `TextLine::text_runs`, which exposes the post-BiDi *visual*
ordering used for rendering.

When the line has been finalized (the normal case after
`TextLineImpl::finalize_line`), the enumerator iterates over the indexed
text runs — a level-resolved table that maps each run back to its original
logical position. If the line hasn't been finalized (or the line is not a
`TextLineImpl`), it falls back to the raw `TextLine::text_runs` list.

Internal upstream; public so that the Skia unit tests reach it.

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

## Members

- [`new`](#function-new)
- [`with_direction`](#function-with_direction)
- [`count`](#function-count)
- [`move_next`](#function-move_next)

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

### new

```rust
fn new(line: &'a dyn TextLine) -> Self
```



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

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

### with_direction

```rust
fn with_direction(line: &'a dyn TextLine, backward: bool) -> Self
```



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

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

### count

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

The number of runs.

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

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

### move_next

```rust
fn move_next(self: &mut Self) -> Option<Rc<dyn TextRun>>
```



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

## Trait implementations

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

## Availability

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