pub struct QueryParams { /* private fields */ }Expand description
A mutable collection of query parameters that serializes booleans as 0/1 and
omits None values, matching the Apify API conventions.
Implementations§
Source§impl QueryParams
impl QueryParams
Sourcepub fn add_str(
&mut self,
key: &str,
value: Option<impl Into<String>>,
) -> &mut Self
pub fn add_str( &mut self, key: &str, value: Option<impl Into<String>>, ) -> &mut Self
Adds a string parameter if value is Some.
Sourcepub fn add_int(&mut self, key: &str, value: Option<i64>) -> &mut Self
pub fn add_int(&mut self, key: &str, value: Option<i64>) -> &mut Self
Adds an integer parameter if value is Some.
Sourcepub fn add_float(&mut self, key: &str, value: Option<f64>) -> &mut Self
pub fn add_float(&mut self, key: &str, value: Option<f64>) -> &mut Self
Adds a floating-point parameter if value is Some.
Sourcepub fn add_bool(&mut self, key: &str, value: Option<bool>) -> &mut Self
pub fn add_bool(&mut self, key: &str, value: Option<bool>) -> &mut Self
Adds a boolean parameter, encoded as 1/0, if value is Some.
Sourcepub fn add_csv(&mut self, key: &str, value: Option<&[String]>) -> &mut Self
pub fn add_csv(&mut self, key: &str, value: Option<&[String]>) -> &mut Self
Adds a comma-joined list parameter if value is Some and non-empty.
Sourcepub fn apply_to_url(&self, url: &str) -> String
pub fn apply_to_url(&self, url: &str) -> String
Appends these parameters as a query string to url.
Trait Implementations§
Source§impl Clone for QueryParams
impl Clone for QueryParams
Source§fn clone(&self) -> QueryParams
fn clone(&self) -> QueryParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QueryParams
impl Debug for QueryParams
Source§impl Default for QueryParams
impl Default for QueryParams
Source§fn default() -> QueryParams
fn default() -> QueryParams
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for QueryParams
impl RefUnwindSafe for QueryParams
impl Send for QueryParams
impl Sync for QueryParams
impl Unpin for QueryParams
impl UnsafeUnpin for QueryParams
impl UnwindSafe for QueryParams
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