Enum query_structure::filter::Filter
source · pub enum Filter {
And(Vec<Filter>),
Or(Vec<Filter>),
Not(Vec<Filter>),
Scalar(ScalarFilter),
ScalarList(ScalarListFilter),
OneRelationIsNull(OneRelationIsNullFilter),
Relation(RelationFilter),
Composite(CompositeFilter),
BoolFilter(bool),
Aggregation(AggregationFilter),
Empty,
}
Variants§
And(Vec<Filter>)
Or(Vec<Filter>)
Not(Vec<Filter>)
Scalar(ScalarFilter)
ScalarList(ScalarListFilter)
OneRelationIsNull(OneRelationIsNullFilter)
Relation(RelationFilter)
Composite(CompositeFilter)
BoolFilter(bool)
Aggregation(AggregationFilter)
Empty
Implementations§
source§impl Filter
impl Filter
pub fn and(filters: Vec<Filter>) -> Self
pub fn or(filters: Vec<Filter>) -> Self
pub fn not(filters: Vec<Filter>) -> Self
pub fn empty() -> Self
sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Returns the size of the topmost filter elements (does not recursively compute the size).
pub fn should_batch(&self, chunk_size: usize) -> bool
pub fn can_batch(&self) -> bool
pub fn batched(self, chunk_size: usize) -> Vec<Filter>
pub fn set_mode(&mut self, mode: QueryMode)
pub fn count(condition: Filter) -> Self
pub fn average(condition: Filter) -> Self
pub fn sum(condition: Filter) -> Self
pub fn min(condition: Filter) -> Self
pub fn max(condition: Filter) -> Self
pub fn as_scalar(&self) -> Option<&ScalarFilter>
pub fn into_scalar(self) -> Option<ScalarFilter>
pub fn is_empty(&self) -> bool
pub fn scalars(&self) -> Vec<ScalarFieldRef>
pub fn unique_scalars(&self) -> Vec<ScalarFieldRef>
sourcepub fn has_relations(&self) -> bool
pub fn has_relations(&self) -> bool
Returns true if filter contains conditions on relation fields.
Trait Implementations§
source§impl From<CompositeFilter> for Filter
impl From<CompositeFilter> for Filter
source§fn from(cf: CompositeFilter) -> Self
fn from(cf: CompositeFilter) -> Self
Converts to this type from the input type.
source§impl From<OneRelationIsNullFilter> for Filter
impl From<OneRelationIsNullFilter> for Filter
source§fn from(sf: OneRelationIsNullFilter) -> Self
fn from(sf: OneRelationIsNullFilter) -> Self
Converts to this type from the input type.
source§impl From<RelationFilter> for Filter
impl From<RelationFilter> for Filter
source§fn from(sf: RelationFilter) -> Self
fn from(sf: RelationFilter) -> Self
Converts to this type from the input type.
source§impl From<ScalarFilter> for Filter
impl From<ScalarFilter> for Filter
source§fn from(sf: ScalarFilter) -> Self
fn from(sf: ScalarFilter) -> Self
Converts to this type from the input type.
source§impl From<ScalarListFilter> for Filter
impl From<ScalarListFilter> for Filter
source§fn from(sf: ScalarListFilter) -> Self
fn from(sf: ScalarListFilter) -> Self
Converts to this type from the input type.
source§impl PartialEq for Filter
impl PartialEq for Filter
impl Eq for Filter
impl StructuralEq for Filter
impl StructuralPartialEq for Filter
Auto Trait Implementations§
impl !RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl !UnwindSafe for Filter
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
source§impl<T> CallHasher for Twhere
T: Hash + ?Sized,
impl<T> CallHasher for Twhere T: Hash + ?Sized,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.