pub struct Query { /* private fields */ }Expand description
Ordered query parameters for an OCS call.
OCS reads parameters by name, so order does not matter to the server, but insertion order is preserved here to keep a built query stable across runs and comparable in tests.
Implementations§
Source§impl Query
impl Query
Sourcepub fn param(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn param(self, key: impl Into<String>, value: impl Into<String>) -> Self
Adds a parameter, replacing an existing one with the same name.
Keys and values are percent-encoded when the query is built, so callers
pass raw text: a value containing & or = stays one value.
Sourcepub fn format(self, format: OcsFormat) -> Self
pub fn format(self, format: OcsFormat) -> Self
Selects the response format.
Equivalent to .param("format", format), kept as its own method so the
requirement for format=json is impossible to miss at a call site.
Trait Implementations§
impl Eq for Query
impl StructuralPartialEq for Query
Auto Trait Implementations§
impl Freeze for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnsafeUnpin for Query
impl UnwindSafe for Query
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