# ui/autolayout/layoutsymboltype (vanilla-engine 0.4.0)

> https://vanillapunch.com/docs/vanilla-engine/0.4.0/api/ui/autolayout/layoutsymboltype/

Symbol kind inside the solver. (LayoutSymbolType of the original ui/autolayout/layoutsymboltype.js)
- Invalid: an undetermined invalid symbol.
- External: a symbol corresponding one to one with each user LayoutVariable.
- Slack: a slack variable added when turning an inequality constraint into an equality.
- Error: an error variable representing how far a non-required constraint is off.
- Dummy: a marker variable attached to a required equality constraint and looked up when removing it.
- The original is an object holding number values (0 ~ 4). The Rust version is an enum with the same values assigned.

Example: Reading a symbol's kind

```rust
use vanilla::ui::autolayout::layoutsymbol::LayoutSymbol;
use vanilla::ui::autolayout::layoutsymboltype::LayoutSymbolType;

let slack_symbol = LayoutSymbol::new(LayoutSymbolType::Slack);
assert_eq!(slack_symbol.get_type(), LayoutSymbolType::Slack);
assert_eq!(LayoutSymbol::invalid().get_type(), LayoutSymbolType::Invalid);
assert_eq!(LayoutSymbolType::Dummy as i32, 4);
```

## LayoutSymbolType (enum) (Clone, Copy, Debug, PartialEq, Eq, Hash)

Symbol kind inside the solver.

- `Invalid` = `0`: Invalid.
- `External` = `1`: User variable.
- `Slack` = `2`: Slack variable.
- `Error` = `3`: Error variable.
- `Dummy` = `4`: Marker variable of a required equality.
