# TextHitTestResult

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

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

```rust
struct TextHitTestResult
```

Holds a hit test result from a text layout.

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

## Members

- [`new`](#function-new)
- [`character_hit`](#function-character_hit)
- [`is_inside`](#function-is_inside)
- [`text_position`](#function-text_position)
- [`is_trailing`](#function-is_trailing)

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

### new

```rust
const fn new(character_hit: CharacterHit, text_position: i32, is_inside: bool, is_trailing: bool) -> Self
```



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

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

### character_hit

```rust
const fn character_hit(self: &Self) -> CharacterHit
```

Gets the character hit of the hit test result.

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

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

### is_inside

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

Gets a value indicating whether the point is inside the bounds of the text layout.

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

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

### text_position

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

Gets the index of the hit character in the text.

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

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

### is_trailing

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

Gets a value indicating whether the hit is on the trailing edge of the character.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ResourceKeyObject`](/docs/0.5.0/api/ferroui-base/controls/trait-resourcekeyobject/)
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `Debug`
- `Default`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Hash`

## Availability

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