baserow_rs::filter

Enum Filter

Source
pub enum Filter {
Show 71 variants Equal, NotEqual, DateIs, DateIsNot, DateIsBefore, DateIsOnOrBefore, DateIsAfter, DateIsOnOrAfter, DateIsWithin, DateEqual, DateNotEqual, DateEqualsToday, DateBeforeToday, DateAfterToday, DateWithinDays, DateWithinWeeks, DateWithinMonths, DateEqualsDaysAgo, DateEqualsMonthsAgo, DateEqualsYearsAgo, DateEqualsWeek, DateEqualsMonth, DateEqualsYear, DateEqualsDayOfMonth, DateBefore, DateBeforeOrEqual, DateAfter, DateAfterOrEqual, DateAfterDaysAgo, HasEmptyValue, HasNotEmptyValue, HasValueEqual, HasNotValueEqual, HasValueContains, HasNotValueContains, HasValueContainsWord, HasNotValueContainsWord, HasValueLengthIsLowerThan, HasAllValuesEqual, HasAnySelectOptionEqual, HasNoneSelectOptionEqual, Contains, ContainsNot, ContainsWord, DoesntContainWord, FilenameContains, HasFileType, FilesLowerThan, LengthIsLowerThan, HigherThan, HigherThanOrEqual, LowerThan, LowerThanOrEqual, IsEvenAndWhole, SingleSelectEqual, SingleSelectNotEqual, SingleSelectIsAnyOf, SingleSelectIsNoneOf, Boolean, LinkRowHas, LinkRowHasNot, LinkRowContains, LinkRowNotContains, MultipleSelectHas, MultipleSelectHasNot, MultipleCollaboratorsHas, MultipleCollaboratorsHasNot, Empty, NotEmpty, UserIs, UserIsNot,
}
Expand description

Filter operations available for querying Baserow tables

This enum provides all the possible filter operations that can be used when querying table rows. The filters are grouped by type (text, date, number, etc.) and provide rich comparison capabilities.

§Example

use baserow_rs::{ConfigBuilder, Baserow, BaserowTableOperations, filter::Filter, api::client::BaserowClient};
use std::collections::HashMap;
use serde_json::Value;

#[tokio::main]
async fn main() {
    let config = ConfigBuilder::new()
        .base_url("https://api.baserow.io")
        .api_key("your-api-key")
        .build();

    let baserow = Baserow::with_configuration(config);
    let table = baserow.table_by_id(1234);

    // Query with multiple filters
    let results = table.query()
        .filter_by("Status", Filter::Equal, "Active")
        .filter_by("Age", Filter::HigherThan, "18")
        .filter_by("Name", Filter::Contains, "John")
        .get::<HashMap<String, Value>>()
        .await
        .unwrap();
}

Variants§

§

Equal

Exact match comparison Field value must exactly match the provided value Example: .filter_by("Status", Filter::Equal, "Active")

§

NotEqual

Inverse of Equal Field value must not match the provided value

§

DateIs

Date field matches exact date

§

DateIsNot

Date field does not match exact date

§

DateIsBefore

Date field is before specified date

§

DateIsOnOrBefore

Date field is on or before specified date

§

DateIsAfter

Date field is after specified date

§

DateIsOnOrAfter

Date field is on or after specified date

§

DateIsWithin

Date field is within specified range

§

DateEqual

Legacy exact date match

§

DateNotEqual

Legacy date not equal

§

DateEqualsToday

Date field is today

§

DateBeforeToday

Date field is before today

§

DateAfterToday

Date field is after today

§

DateWithinDays

Date is within specified number of days

§

DateWithinWeeks

Date is within specified number of weeks

§

DateWithinMonths

Date is within specified number of months

§

DateEqualsDaysAgo

Date is exactly specified number of days ago

§

DateEqualsMonthsAgo

Date is exactly specified number of months ago

§

DateEqualsYearsAgo

Date is exactly specified number of years ago

§

DateEqualsWeek

Date is in specified week

§

DateEqualsMonth

Date is in specified month

§

DateEqualsYear

Date is in specified year

§

DateEqualsDayOfMonth

Date matches specific day of month

§

DateBefore

Legacy before date

§

DateBeforeOrEqual

Legacy before or equal date

§

DateAfter

Legacy after date

§

DateAfterOrEqual

Legacy after or equal date

§

DateAfterDaysAgo

Date is after specified number of days ago

§

HasEmptyValue

Field has empty value

§

HasNotEmptyValue

Field has non-empty value

§

HasValueEqual

Field has specific value

§

HasNotValueEqual

Field does not have specific value

§

HasValueContains

Field value contains substring

§

HasNotValueContains

Field value does not contain substring

§

HasValueContainsWord

Field value contains specific word

§

HasNotValueContainsWord

Field value does not contain specific word

§

HasValueLengthIsLowerThan

Field value length is less than specified

§

HasAllValuesEqual

All values in field equal specified value

§

HasAnySelectOptionEqual

Any select option matches value

§

HasNoneSelectOptionEqual

No select option matches value

§

Contains

Text contains substring Example: .filter_by("Name", Filter::Contains, "John")

§

ContainsNot

Text does not contain substring

§

ContainsWord

Text contains whole word

§

DoesntContainWord

Text does not contain whole word

§

FilenameContains

Filename contains substring

§

HasFileType

File is of specified type

§

FilesLowerThan

Number of files is less than specified

§

LengthIsLowerThan

Text length is less than specified

§

HigherThan

Number is greater than value Example: .filter_by("Age", Filter::HigherThan, "18")

§

HigherThanOrEqual

Number is greater than or equal to value

§

LowerThan

Number is less than value

§

LowerThanOrEqual

Number is less than or equal to value

§

IsEvenAndWhole

Number is even and whole

§

SingleSelectEqual

Single select matches value

§

SingleSelectNotEqual

Single select does not match value

§

SingleSelectIsAnyOf

Single select matches any of values

§

SingleSelectIsNoneOf

Single select matches none of values

§

Boolean

Boolean field matches value

§

LinkRowHas

Linked row exists

§

LinkRowHasNot

Linked row does not exist

§

LinkRowContains

Linked row contains value

§

LinkRowNotContains

Linked row does not contain value

§

MultipleSelectHas

Multiple select includes value

§

MultipleSelectHasNot

Multiple select does not include value

§

MultipleCollaboratorsHas

Multiple collaborators includes user

§

MultipleCollaboratorsHasNot

Multiple collaborators does not include user

§

Empty

Field is empty/null

§

NotEmpty

Field is not empty/null

§

UserIs

Field matches specific user

§

UserIsNot

Field does not match specific user

Implementations§

Source§

impl Filter

Source

pub fn as_str(&self) -> &'static str

Converts the filter to its string representation for API requests

Trait Implementations§

Source§

impl Clone for Filter

Source§

fn clone(&self) -> Filter

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Filter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Filter

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T