# TextHighlightMerge

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/documents/struct-texthighlightmerge/

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

```rust
struct TextHighlightMerge
```

Splits overlapping layers into ordered, disjoint regions.

Later additions replace the complete foreground/background pair. Selection
therefore has highest priority when a view adds it after its highlighters.
Adjacent regions remain separate, matching the source merge algorithm.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/text_highlight_merge.rs#L62)

## Members

- [`new`](#function-new)
- [`from_regions`](#function-from_regions)
- [`merge`](#function-merge)
- [`add_region`](#function-add_region)
- [`iter`](#function-iter)
- [`regions`](#function-regions)
- [`into_regions`](#function-into_regions)
- [`is_empty`](#function-is_empty)
- [`len`](#function-len)
- [`clear`](#function-clear)

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

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/text_highlight_merge.rs#L67)

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

### from_regions

```rust
fn from_regions(regions: impl IntoIterator<Item = TextHighlightRegion>) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/text_highlight_merge.rs#L71)

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

### merge

```rust
fn merge(self: &mut Self, region: TextHighlightRegion)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/text_highlight_merge.rs#L79)

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

### add_region

```rust
fn add_region(self: &mut Self, region: TextHighlightRegion)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/text_highlight_merge.rs#L83)

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

### iter

```rust
fn iter(self: &Self) -> impl DoubleEndedIterator<Item = &TextHighlightRegion> + ExactSizeIterator
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/text_highlight_merge.rs#L124)

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

### regions

```rust
fn regions(self: &Self) -> Vec<TextHighlightRegion>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/text_highlight_merge.rs#L129)

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

### into_regions

```rust
fn into_regions(self: Self) -> Vec<TextHighlightRegion>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/text_highlight_merge.rs#L132)

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

### is_empty

```rust
fn is_empty(self: &Self) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/text_highlight_merge.rs#L135)

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

### len

```rust
fn len(self: &Self) -> usize
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/text_highlight_merge.rs#L138)

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

### clear

```rust
fn clear(self: &mut Self)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/text_highlight_merge.rs#L141)

## Trait implementations

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

## Availability

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