# query.private.Predicate.validate_enum

- **Module:** query.private.Predicate
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/query/private.rs#L540
- **Page:** https://libtmux.org/reference/rs/query-private-predicate-validate_enum/

```
query.private.Predicate.validate_enum(self, variants: &[&str]) -> Result<(), FilterExpressionError>
```

Validate this predicate against a custom enum's stable variants.

# Errors

Returns [`FilterExpressionErrorKind::UnknownOperator`] for another
scalar family, [`FilterExpressionErrorKind::InvalidStructure`] for
an invalid equality shape, or
[`FilterExpressionErrorKind::InvalidLiteral`] for an unknown
variant.

The [`crate::query::Filterable`] example executes this method in a
hand-written generated-code expansion.
