Skip to main content

SearchParamsBuilder

Struct SearchParamsBuilder 

Source
pub struct SearchParamsBuilder { /* private fields */ }
Expand description

Typed builder for SearchParams that accepts DateTime<Utc> for date filters and ensures they’re emitted in RFC 3339 millisecond form.

Implementations§

Source§

impl SearchParamsBuilder

Source

pub fn new() -> Self

Start an empty builder.

Source

pub fn q(self, q: impl Into<String>) -> Self

Full-text query.

Source

pub fn context_type(self, t: impl Into<String>) -> Self

Filter on type.

Source

pub fn domain(self, d: impl Into<String>) -> Self

Filter on domain.

Source

pub fn tags(self, t: impl Into<String>) -> Self

Filter on tags (comma-separated).

Source

pub fn agent_id(self, a: impl Into<String>) -> Self

Filter on agent_id.

Source

pub fn derived_from(self, c: impl Into<String>) -> Self

Filter to contexts whose derived_from includes this ctx_id.

Source

pub fn derived_from_ctx_id(self, c: &CtxId) -> Self

Typed alternative to Self::derived_from — accepts a strongly typed CtxId so callers don’t pass arbitrary strings.

Source

pub fn tag(self, t: impl Into<String>) -> Self

Accumulate a tag. Multiple calls are joined with , for the AND-semantics matcher per RFC-ACDP-0005 §2.1.

Source

pub fn created_after(self, dt: DateTime<Utc>) -> Self

Lower bound on created_at.

Source

pub fn created_before(self, dt: DateTime<Utc>) -> Self

Upper bound on created_at.

Source

pub fn data_period_start_after(self, dt: DateTime<Utc>) -> Self

Lower bound on data_period.start.

Source

pub fn data_period_end_before(self, dt: DateTime<Utc>) -> Self

Upper bound on data_period.end.

Source

pub fn expires_after(self, dt: DateTime<Utc>) -> Self

Lower bound on expires_at.

Source

pub fn expires_before(self, dt: DateTime<Utc>) -> Self

Upper bound on expires_at.

Source

pub fn status(self, s: impl Into<String>) -> Self

Status filter.

Source

pub fn limit(self, l: u32) -> Self

Result page size cap.

Source

pub fn cursor(self, c: impl Into<String>) -> Self

Pagination cursor.

Source

pub fn build(self) -> SearchParams

Finalize.

Trait Implementations§

Source§

impl Default for SearchParamsBuilder

Source§

fn default() -> SearchParamsBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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.