FilterSchema
A filter target whose portable expression grammar can be described.
Source and package
- Qualified name
-
libtmux::query:: schema:: Filter Schema - Module
- query.schema
- Package
- libtmux
- Source
- crates/libtmux/src/query/schema.rs
-
Description#
#[derive(libtmux::Filterable)]implements this andFilterablefrom the same field declaration. Implement it manually only when a handwrittenFilterabletarget must also expose aJsonSchemafor itsFilterExpr.The schema closes targets, fields, operators, relations, and JSON value families. Deserialization remains authoritative for fixed-width integer bounds, regex compilation, and whole-expression complexity limits.
Examples#
use libtmux::query::FilterExpr;#[derive(libtmux::Filterable)]#[filterable(target = "task")]struct Task {name: String,done: bool,}let schema = schemars::schema_for!(FilterExpr<Task>);assert!(schema.as_object().is_some());