pub struct Values { /* private fields */ }Expand description
Parameters and a body for one operation, keyed on wire names.
Nothing here is checked against a document — that happens once, in
Invocation::new, so there is exactly one place that decides what
satisfies an operation.
Implementations§
Source§impl Values
impl Values
pub fn new() -> Self
Sourcepub fn param(self, name: impl Into<String>, value: impl ToString) -> Self
pub fn param(self, name: impl Into<String>, value: impl ToString) -> Self
One parameter, under the name the document gives it.
Sourcepub fn maybe(
self,
name: impl Into<String>,
value: Option<impl ToString>,
) -> Self
pub fn maybe( self, name: impl Into<String>, value: Option<impl ToString>, ) -> Self
The same, for an optional parameter: None adds nothing.
Sourcepub fn each(
self,
name: impl Into<String>,
values: impl IntoIterator<Item = impl ToString>,
) -> Self
pub fn each( self, name: impl Into<String>, values: impl IntoIterator<Item = impl ToString>, ) -> Self
Every value of a list parameter, under the name the document gives it.
A list reaches the request builder as the name repeated, which is exactly what a repeated flag reaches it with — so the two consumers hand over the same thing, and how the repeats are laid out in the request is the document’s to say rather than either caller’s. An empty list adds nothing, and is the same as not naming the parameter at all.
pub fn json(self, value: Value) -> Self
pub fn raw(self, bytes: Vec<u8>) -> Self
pub fn multipart(self, parts: Vec<Part>) -> Self
Sourcepub fn body(self, body: Option<Payload>) -> Self
pub fn body(self, body: Option<Payload>) -> Self
Attach body when there is one; leave the body alone when there is not.
pub fn params(&self) -> &[(String, String)]
pub fn payload(&self) -> Option<&Payload>
Trait Implementations§
impl Eq for Values
impl StructuralPartialEq for Values
Auto Trait Implementations§
impl Freeze for Values
impl RefUnwindSafe for Values
impl Send for Values
impl Sync for Values
impl Unpin for Values
impl UnsafeUnpin for Values
impl UnwindSafe for Values
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.