# query.Matcher

- **Module:** query
- **Package:** libtmux
- **Language:** Rust
- **Kind:** trait
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/query.rs#L412
- **Page:** https://libtmux.org/reference/rs/query-matcher/

A predicate that evaluates a borrowed candidate.

Functions and closures with the same signature implement this trait.

## Example

```rust
use libtmux::query::Matcher;

struct IsEven;

impl Matcher<i32> for IsEven {
    fn matches(&self, candidate: &i32) -> bool {
        candidate % 2 == 0
    }
}

assert!(IsEven.matches(&2));
assert!(!IsEven.matches(&3));
```
