pub fn query<Q: serde::Serialize>(mut self, query: &Q) -> Self {
        let mut uri_parts = self.parts.uri.into_parts();
        let path = uri_parts.path_and_query;

        let mut buffer = utils::BytesWriter::with_smol_capacity();
        let query = serde_urlencoded::to_string(&query).expect("To url-encode");

        let _ = match path {
            Some(path) => write!(buffer, "{}?{}", path.path(), query),
            None => write!(buffer, "?{}", query),
        };

        uri_parts.path_and_query = Some(http::uri::PathAndQuery::from_maybe_shared(buffer.into_inner().freeze()).expect("To create path and query"));

        self.parts.uri = match http::Uri::from_parts(uri_parts) {
            Ok(uri) => uri,
            Err(error) => panic!("Unable to set query for URI: {}", error)
        };
        self
    }
///Sets request's query by overwriting existing one, if any.
///
///# Panics
///
///- If unable to encode data.
///- If URI creation fails
Sets request's query by overwriting existing one, if any.
Sets request ' s query by overwriting existing one if any .
pub fn query<Q: serde::Serialize>(mut self, query: &Q) -> Self {
        let mut uri_parts = self.parts.uri.into_parts();
        let path = uri_parts.path_and_query;
        let mut buffer = utils::BytesWriter::with_smol_capacity();
        let query = serde_urlencoded::to_string(&query).expect("To url-encode");
        let _ = match path {
            Some(path) => write!(buffer, "{}?{}", path.path(), query),
            None => write!(buffer, "?{}", query),
        };
        uri_parts.path_and_query = Some(http::uri::PathAndQuery::from_maybe_shared(buffer.into_inner().freeze()).expect("To create path and query"));
        self.parts.uri = match http::Uri::from_parts(uri_parts) {
            Ok(uri) => uri,
            Err(error) => panic!("Unable to set query for URI: {}", error)
        };
        self
    }
pub fn query < Q : serde :: Serialize > ( mut self , query : & Q ) -> Self { let mut uri_parts = self . parts . uri . into_parts ( ) ; let path = uri_parts . path_and_query ; let mut buffer = utils :: BytesWriter :: with_smol_capacity ( ) ; let query = serde_urlencoded :: to_string ( & query ) . expect ( " " ) ; let _ = match path { Some ( path ) => write ! ( buffer " " path path ( ) query ) , None => write ! ( buffer " " query ) , } ; uri_parts . path_and_query = Some ( http :: uri :: PathAndQuery :: from_maybe_shared ( buffer . into_inner ( ) . freeze ( ) ) . expect ( " " ) ) ; self . parts . uri = match http :: Uri :: from_parts ( uri_parts ) { Ok ( uri ) => uri , Err ( error ) => panic ! ( " " error ) } ; self }
Sets request's query by overwriting existing one, if any.
Sets request ' s query by overwriting existing one if any .
mut self
query
&Q
panics
If unable to encode data.
If URI creation fails
If unable to encode data . If URI creation fails