# Edit

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-designer-core/enum-edit/

**enum** · [`ferroui-designer-core`](/docs/0.5.0/api/ferroui-designer-core/) · v0.5.0

```rust
enum Edit
```

Commands are evaluated against a private candidate, then committed once.
Consecutive attribute edits are validated together, allowing a property and
its namespace declaration in either order. Other commands observe preceding
commands. Element-child indices exclude text, whitespace and comments. Move
indices refer to the destination list after removing the moving node.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Core/document.rs#L73)

## Members

- [`SetAttribute`](#variant-setattribute)
- [`RemoveAttribute`](#variant-removeattribute)
- [`InsertChild`](#variant-insertchild)
- [`RemoveNode`](#variant-removenode)
- [`MoveNode`](#variant-movenode)
- [`ReplaceSource`](#variant-replacesource)
- [`Text`](#variant-text)

<a id="variant-setattribute"></a>

### SetAttribute

```rust
SetAttribute { node: crate::NodeId, name: String, value: String }
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Core/document.rs#L74)

<a id="variant-removeattribute"></a>

### RemoveAttribute

```rust
RemoveAttribute { node: crate::NodeId, name: String }
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Core/document.rs#L79)

<a id="variant-insertchild"></a>

### InsertChild

```rust
InsertChild { parent: crate::NodeId, index: usize, source: String }
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Core/document.rs#L83)

<a id="variant-removenode"></a>

### RemoveNode

```rust
RemoveNode { node: crate::NodeId }
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Core/document.rs#L88)

<a id="variant-movenode"></a>

### MoveNode

```rust
MoveNode { node: crate::NodeId, parent: crate::NodeId, index: usize }
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Core/document.rs#L91)

<a id="variant-replacesource"></a>

### ReplaceSource

```rust
ReplaceSource { source: String }
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Core/document.rs#L96)

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

### Text

```rust
Text { span: crate::SourceSpan, replacement: String }
```

A UTF-8 byte-range edit in the current candidate source. For simultaneous
source-coordinate patches use `Document::apply_text_patches`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Core/document.rs#L101)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `DeserializeOwned`
- `Clone`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Serialize`
- `Deserialize<'de>`

## Availability

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