Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

trait libtmux-rs latest

Matcher

A predicate that evaluates a borrowed candidate.

Source and package
Qualified name
libtmux::query::Matcher
Module
query
Package
libtmux
Source
crates/libtmux/src/query.rs
trait query.Matcher

Description#

Functions and closures with the same signature implement this trait.

Examples#

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));
Type parameters

Members1#

  • matches method Return whether candidate matches this predicate.
Esc

Type to search.

Reference previewOpen reference