use pyo3::prelude::*; use pyo3::PyObjectProtocol; use tantivy as tv; /// Tantivy's Query #[pyclass] pub(crate) struct Query { pub(crate) inner: Box, } impl Query { pub(crate) fn get(&self) -> &dyn tv::query::Query { &self.inner } } #[pyproto] impl PyObjectProtocol for Query { fn __repr__(&self) -> PyResult { Ok(format!("Query({:?})", self.get())) } }