pub struct QueryEngine { /* private fields */ }Expand description
Query engine for ULS data.
Implementations§
Source§impl QueryEngine
impl QueryEngine
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self, QueryError>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, QueryError>
Open a query engine with the given database path.
Sourcepub fn with_database(db: Database) -> Self
pub fn with_database(db: Database) -> Self
Create a query engine with an existing database.
Sourcepub fn lookup(&self, callsign: &str) -> Result<Option<License>, QueryError>
pub fn lookup(&self, callsign: &str) -> Result<Option<License>, QueryError>
Look up a license by callsign.
Sourcepub fn lookup_by_frn(&self, frn: &str) -> Result<Vec<License>, QueryError>
pub fn lookup_by_frn(&self, frn: &str) -> Result<Vec<License>, QueryError>
Look up all licenses by FRN (FCC Registration Number).
Sourcepub fn search(&self, filter: SearchFilter) -> Result<Vec<License>, QueryError>
pub fn search(&self, filter: SearchFilter) -> Result<Vec<License>, QueryError>
Search for licenses matching the given filter.
Sourcepub fn stats(&self) -> Result<LicenseStats, QueryError>
pub fn stats(&self) -> Result<LicenseStats, QueryError>
Get database statistics.
Sourcepub fn is_ready(&self) -> Result<bool, QueryError>
pub fn is_ready(&self) -> Result<bool, QueryError>
Check if the database is ready for queries.
Sourcepub fn count(&self, filter: SearchFilter) -> Result<usize, QueryError>
pub fn count(&self, filter: SearchFilter) -> Result<usize, QueryError>
Get the count of results for a filter without fetching all data.
Sourcepub fn required_record_types(filter: &SearchFilter) -> Vec<&'static str>
pub fn required_record_types(filter: &SearchFilter) -> Vec<&'static str>
Determine which record types are required for basic queries.
Returns the minimal set of record types needed:
- HD (licenses) - always needed
- EN (entities) - needed for name/address/FRN
- AM (amateur) - needed if operator_class filter is used
Sourcepub fn missing_data_for_query(
&self,
service: &str,
filter: &SearchFilter,
) -> Result<Vec<String>, QueryError>
pub fn missing_data_for_query( &self, service: &str, filter: &SearchFilter, ) -> Result<Vec<String>, QueryError>
Check if any required record types are missing for a given service.
Returns a list of missing record types that need to be imported.
Sourcepub fn has_basic_data(&self, service: &str) -> Result<bool, QueryError>
pub fn has_basic_data(&self, service: &str) -> Result<bool, QueryError>
Check if data is available for basic queries (HD + EN at minimum).
Sourcepub fn imported_types(&self, service: &str) -> Result<Vec<String>, QueryError>
pub fn imported_types(&self, service: &str) -> Result<Vec<String>, QueryError>
Get the list of imported record types for a service.
Auto Trait Implementations§
impl Freeze for QueryEngine
impl !RefUnwindSafe for QueryEngine
impl Send for QueryEngine
impl Sync for QueryEngine
impl Unpin for QueryEngine
impl UnsafeUnpin for QueryEngine
impl !UnwindSafe for QueryEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more