winbrew_models\package/query.rs
1//! Lightweight query model for package search.
2
3/// A normalized package search query.
4///
5/// `terms` preserves the tokenized search text while `version` carries an
6/// optional version filter that can be applied by the search layer.
7#[derive(Debug, Clone)]
8pub struct PackageQuery {
9 /// Search terms in display order.
10 pub terms: Vec<String>,
11 /// Optional version constraint supplied by the caller.
12 pub version: Option<String>,
13}
14
15impl PackageQuery {
16 /// Reconstruct the human-readable search text from the stored terms.
17 pub fn text(&self) -> String {
18 self.terms.join(" ")
19 }
20}