pub struct SearchFilter {Show 19 fields
pub filters: Vec<FilterExpr>,
pub sort_field: Option<String>,
pub sort_desc: bool,
pub callsign: Option<String>,
pub name: Option<String>,
pub city: Option<String>,
pub state: Option<String>,
pub zip_code: Option<String>,
pub radio_service: Option<Vec<String>>,
pub status: Option<char>,
pub operator_class: Option<char>,
pub active_only: bool,
pub frn: Option<String>,
pub limit: Option<usize>,
pub offset: Option<usize>,
pub sort: SortOrder,
pub granted_after: Option<String>,
pub granted_before: Option<String>,
pub expires_before: Option<String>,
}Expand description
Filter criteria for license searches.
Fields§
§filters: Vec<FilterExpr>Generic filter expressions (e.g., “grant_date>2025-01-01”, “state=TX”).
sort_field: Option<String>Sort by field name (prefix with - for descending).
sort_desc: boolSort direction (true = descending).
callsign: Option<String>Filter by callsign pattern (supports wildcards).
name: Option<String>Filter by name (partial match).
city: Option<String>Filter by city.
state: Option<String>Filter by state (2-letter code).
zip_code: Option<String>Filter by ZIP code.
radio_service: Option<Vec<String>>Filter by radio service code(s).
status: Option<char>Filter by license status (A=Active, E=Expired, etc.).
operator_class: Option<char>Filter by operator class (for amateur).
active_only: boolOnly include active licenses.
frn: Option<String>FRN filter.
limit: Option<usize>Maximum results to return.
offset: Option<usize>Number of results to skip (for pagination).
sort: SortOrderSort order (legacy enum, use sort_field for generic).
granted_after: Option<String>Filter by grant date (licenses granted on or after this date).
granted_before: Option<String>Filter by grant date (licenses granted on or before this date).
expires_before: Option<String>Filter by expiration date (licenses expiring on or before this date).
Implementations§
Source§impl SearchFilter
impl SearchFilter
Sourcepub fn location(city: Option<String>, state: Option<String>) -> Self
pub fn location(city: Option<String>, state: Option<String>) -> Self
Create a filter for location search.
Sourcepub fn with_limit(self, limit: usize) -> Self
pub fn with_limit(self, limit: usize) -> Self
Set the maximum results.
Sourcepub fn with_offset(self, offset: usize) -> Self
pub fn with_offset(self, offset: usize) -> Self
Set pagination offset.
Sourcepub fn active_only(self) -> Self
pub fn active_only(self) -> Self
Only include active licenses.
Sourcepub fn with_state(self, state: impl Into<String>) -> Self
pub fn with_state(self, state: impl Into<String>) -> Self
Filter by state.
Sourcepub fn with_operator_class(self, class: char) -> Self
pub fn with_operator_class(self, class: char) -> Self
Filter by operator class.
Sourcepub fn with_filter(self, expr: impl AsRef<str>) -> Self
pub fn with_filter(self, expr: impl AsRef<str>) -> Self
Add a generic filter expression (e.g., “grant_date>2025-01-01”).
Sourcepub fn with_sort_field(self, field: impl Into<String>) -> Self
pub fn with_sort_field(self, field: impl Into<String>) -> Self
Set sort field by name (prefix with - for descending).
Sourcepub fn to_where_clause(&self) -> (String, Vec<String>)
pub fn to_where_clause(&self) -> (String, Vec<String>)
Build the SQL WHERE clause for this filter.
Sourcepub fn order_clause(&self) -> String
pub fn order_clause(&self) -> String
Get the ORDER BY clause.
Sourcepub fn limit_clause(&self) -> String
pub fn limit_clause(&self) -> String
Get the LIMIT clause.
Trait Implementations§
Source§impl Clone for SearchFilter
impl Clone for SearchFilter
Source§fn clone(&self) -> SearchFilter
fn clone(&self) -> SearchFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more