# DocumentSnapshot

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

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

```rust
struct DocumentSnapshot
```

An owned image of document content. Character data and formatting collections
are independent of the live document; embedded controls retain their identity.

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

## Members

- [`paragraphs`](#struct_field-paragraphs)
- [`link_fields`](#struct_field-link_fields)
- [`next_link_field_id`](#struct_field-next_link_field_id)
- [`from_text`](#function-from_text)
- [`text`](#function-text)
- [`text_length`](#function-text_length)
- [`validate`](#function-validate)

<a id="struct_field-paragraphs"></a>

### paragraphs

```rust
paragraphs: Vec<ParagraphSnapshot>
```



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

<a id="struct_field-link_fields"></a>

### link_fields

```rust
link_fields: Vec<super::DocumentLinkField>
```

Instruction metadata in visible UTF-16 coordinates. Rendered hyperlink
segments carry the matching identity; one field may cross paragraphs.

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

<a id="struct_field-next_link_field_id"></a>

### next_link_field_id

```rust
next_link_field_id: u64
```

The next available identity in this snapshot. A live document also keeps
a monotonic allocation floor across undo, so retired handles never alias.

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

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

### from_text

```rust
fn from_text(text: &str) -> Self
```

Creates plain content, normalizing CRLF and CR paragraph separators to LF.

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

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

### text

```rust
fn text(self: &Self) -> String
```



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

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

### text_length

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



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

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

### validate

```rust
fn validate(self: &Self) -> Result<(), super::DocumentError>
```

Checks all values before a restore or insertion can mutate a live tree.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`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/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Default`

## Availability

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