pub trait BaseFilter: Sized {
type Based: AsTable;
// Required methods
fn update_sql<T: FromQuery<Based = Self::Based>>(
&self,
sql: RawSql<T>,
) -> RawSql<T>;
fn queryer(&self) -> &Queryer<'_, impl PostArchiverConnection>;
// Provided method
fn count(&self) -> Result<u64> { ... }
}Available on crate feature
utils only.Expand description
Trait for types that hold filter conditions and can write them into a RawSql.
Query builders (e.g. PostQuery) and decorator wrappers (e.g. Paginated)
implement this trait so that BaseFilter::count() can compute the total matching row count.
The default count() implementation caches its result to avoid redundant queries.
Required Associated Types§
Required Methods§
Sourcefn update_sql<T: FromQuery<Based = Self::Based>>(
&self,
sql: RawSql<T>,
) -> RawSql<T>
fn update_sql<T: FromQuery<Based = Self::Based>>( &self, sql: RawSql<T>, ) -> RawSql<T>
Append all filter conditions held by this builder into sql and return the updated RawSql.
Sourcefn queryer(&self) -> &Queryer<'_, impl PostArchiverConnection>
fn queryer(&self) -> &Queryer<'_, impl PostArchiverConnection>
Return a reference to the Queryer owned by this builder, used by the default count() impl.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.