query.FilterExpr.matches
Rust
- Python Unavailable
- TypeScript Unavailable
- Rust
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- query
- Declared in
- FilterExpr
- Package
- libtmux
- Source
- crates/libtmux/src/query.rs
-
Evaluate this validated expression against
candidate.Evaluation is infallible, ordered, and short-circuiting. Every text predicate first requires strict candidate UTF-8 and returns
falsefor invalid bytes, including empty exclusion. An outerSelf::notcan invert that result.Examples
use libtmux::query::{BoolField, FilterExpressionError, Filterable};use libtmux::query::__private::{self, Predicate};struct Task(bool);struct Fields(BoolField<Task>);impl Filterable for Task {type Fields = Fields;const FILTER_TARGET: &'static str = "task";fn filter_fields() -> Self::Fields {Fields(__private::bool_field(Self::FILTER_TARGET, "done"))}fn __filter_matches(&self, predicate: &Predicate) -> bool {predicate.matches_bool(self.0)}fn __filter_validate(_: &Predicate) -> Result<(), FilterExpressionError> {Ok(())}}let expression = Task::filter_fields().0.eq(true);assert!(expression.matches(&Task(true)));
0 declared, 0 inherited