# SentenceSegment

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

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

```rust
struct SentenceSegment<'a>
```

Represents a segment between two Unicode sentence boundaries (UAX #29).

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

## Members

- [`new`](#function-new)
- [`offset`](#function-offset)
- [`text`](#function-text)

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

### new

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

Initializes a new instance of the `SentenceSegment` struct.

* `offset` - The segment offset in UTF-16 code units within the source span.
* `text` - The slice of the source span that makes up this segment.

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

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

### offset

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

Gets the segment start offset in UTF-16 code units within the source span.

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

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

### text

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

Gets the text content of this segment as a slice of the source span.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`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`

## Availability

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