tantivy-py/src/query.rs

22 lines
383 B
Rust
Raw Normal View History

2022-04-15 03:50:37 +00:00
use pyo3::prelude::*;
use tantivy as tv;
/// Tantivy's Query
#[pyclass(frozen)]
pub(crate) struct Query {
pub(crate) inner: Box<dyn tv::query::Query>,
}
impl Query {
pub(crate) fn get(&self) -> &dyn tv::query::Query {
&self.inner
}
}
2022-04-15 03:50:37 +00:00
#[pymethods]
impl Query {
2019-08-02 11:23:10 +00:00
fn __repr__(&self) -> PyResult<String> {
Ok(format!("Query({:?})", self.get()))
}
}