pub struct QueryBuilder { /* private fields */ }Expand description
Modern query builder with type-safe method chaining Provides a clean, Swift-like API for building HTTP query parameters
Implementations§
Source§impl QueryBuilder
impl QueryBuilder
Sourcepub fn string(self, key: &str, value: impl Into<Option<String>>) -> Self
pub fn string(self, key: &str, value: impl Into<Option<String>>) -> Self
Add a string parameter (accept both required/optional)
Sourcepub fn int(self, key: &str, value: impl Into<Option<i64>>) -> Self
pub fn int(self, key: &str, value: impl Into<Option<i64>>) -> Self
Add an integer parameter (accept both required/optional)
Sourcepub fn datetime(
self,
key: &str,
value: impl Into<Option<DateTime<Utc>>>,
) -> Self
pub fn datetime( self, key: &str, value: impl Into<Option<DateTime<Utc>>>, ) -> Self
Add a datetime parameter
Sourcepub fn uuid(self, key: &str, value: impl Into<Option<Uuid>>) -> Self
pub fn uuid(self, key: &str, value: impl Into<Option<Uuid>>) -> Self
Add a UUID parameter (converts to string)
Sourcepub fn date(self, key: &str, value: impl Into<Option<NaiveDate>>) -> Self
pub fn date(self, key: &str, value: impl Into<Option<NaiveDate>>) -> Self
Add a date parameter (converts NaiveDate to DateTime<Utc>)
Sourcepub fn serialize<T: Serialize>(self, key: &str, value: Option<T>) -> Self
pub fn serialize<T: Serialize>(self, key: &str, value: Option<T>) -> Self
Add any serializable parameter (for enums and complex types)
Sourcepub fn structured_query(
self,
key: &str,
value: impl Into<Option<String>>,
) -> Self
pub fn structured_query( self, key: &str, value: impl Into<Option<String>>, ) -> Self
Parse and add a structured query string Handles complex query patterns like:
- “key:value” patterns
- “key:value1,value2” (comma-separated values)
- Quoted values: “key:"value with spaces"”
- Space-separated terms (treated as AND logic)
Trait Implementations§
Source§impl Debug for QueryBuilder
impl Debug for QueryBuilder
Source§impl Default for QueryBuilder
impl Default for QueryBuilder
Source§fn default() -> QueryBuilder
fn default() -> QueryBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for QueryBuilder
impl RefUnwindSafe for QueryBuilder
impl Send for QueryBuilder
impl Sync for QueryBuilder
impl Unpin for QueryBuilder
impl UnwindSafe for QueryBuilder
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