# LineBreakEnumerator

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

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

```rust
struct LineBreakEnumerator<'a>
```

Enumerates the line break opportunities of UTF-16 text (UAX #14).

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

## Members

- [`new`](#function-new)
- [`text`](#function-text)
- [`move_next`](#function-move_next)
- [`first_required`](#function-first_required)

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

### new

```rust
fn new(text: &'a [u16]) -> Self
```



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

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

### text

```rust
const fn text(self: &Self) -> &'a [u16]
```

The text being enumerated (a public field upstream).

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

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

### move_next

```rust
fn move_next(self: &mut Self) -> Option<LineBreak>
```

Moves to the next `LineBreak`; returns `None` when there are no more.

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

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

### first_required

```rust
fn first_required(text: &[u16]) -> Option<LineBreak>
```

The first required break of `text`: the first break the enumerator gives whose
`LineBreak::required` is set, found without the rules. A break is required after a hard
line break only (classes BK, CR, LF and NL: U+000A to U+000D, U+0085, U+2028 and U+2029;
CR LF breaks once, after the LF), so the text is scanned for those characters; a text
without one has no required break (the break at the end of such a text is not required).

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

## 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`
- `IntoIterator`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Debug`
- `Iterator`

## Availability

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