pub struct Request { /* private fields */ }Expand description
A Kite API request: method, path, query, body and X-Kite-Version header.
Debug hides the values of secret keys in the query and the form.
Implementations§
Source§impl Request
impl Request
Sourcepub fn new(method: Method, path: impl Into<String>) -> Self
pub fn new(method: Method, path: impl Into<String>) -> Self
Creates a request with no query and no body.
Sourcepub fn query<K: Into<String>, V: Into<String>>(
self,
pairs: impl IntoIterator<Item = (K, V)>,
) -> Self
pub fn query<K: Into<String>, V: Into<String>>( self, pairs: impl IntoIterator<Item = (K, V)>, ) -> Self
Appends query parameters.
Sourcepub fn form<K: Into<String>, V: Into<String>>(
self,
pairs: impl IntoIterator<Item = (K, V)>,
) -> Self
pub fn form<K: Into<String>, V: Into<String>>( self, pairs: impl IntoIterator<Item = (K, V)>, ) -> Self
Sets a form-encoded body.
Sourcepub fn kite_version(self, version: &'static str) -> Self
pub fn kite_version(self, version: &'static str) -> Self
Overrides the X-Kite-Version header, which defaults to the Kite Connect
version 3. Some routes outside the Kite Connect docs serve a different
response shape per version.
Sourcepub fn query_pairs(&self) -> &[(String, String)]
pub fn query_pairs(&self) -> &[(String, String)]
Returns the query parameters added with Request::query.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin for Request
impl UnwindSafe for Request
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