pub struct RequestOptions {
pub query: QueryParams,
pub headers: Headers,
pub accept: Option<String>,
pub if_match: Option<String>,
pub if_none_match: Option<String>,
}Expand description
Everything a single call may add to a request.
Fields§
§query: QueryParamsQuery parameters, repeated parameters kept in order.
headers: HeadersExtra request headers.
accept: Option<String>Override the Accept header of the client.
if_match: Option<String>If-Match precondition.
if_none_match: Option<String>If-None-Match precondition.
Implementations§
Source§impl RequestOptions
impl RequestOptions
Sourcepub fn with_query<N: Into<String>>(self, name: N, value: &LinoValue) -> Self
pub fn with_query<N: Into<String>>(self, name: N, value: &LinoValue) -> Self
The same options with one more query parameter.
§Examples
use lino_rest_api::client::RequestOptions;
use lino_rest_api::value::boolean;
let options = RequestOptions::new().with_query("done", &boolean(false));
assert_eq!(options.query.to_query_string(), "done=false");Sourcepub fn with_query_text<N: Into<String>, V: Into<String>>(
self,
name: N,
value: V,
) -> Self
pub fn with_query_text<N: Into<String>, V: Into<String>>( self, name: N, value: V, ) -> Self
The same options with one more textual query parameter.
Sourcepub fn with_header<N: Into<String>, V: Into<String>>(
self,
name: N,
value: V,
) -> Self
pub fn with_header<N: Into<String>, V: Into<String>>( self, name: N, value: V, ) -> Self
The same options with one more request header.
Sourcepub fn with_accept<S: Into<String>>(self, accept: S) -> Self
pub fn with_accept<S: Into<String>>(self, accept: S) -> Self
The same options asking for another representation.
Sourcepub fn if_match<S: Into<String>>(self, etag: S) -> Self
pub fn if_match<S: Into<String>>(self, etag: S) -> Self
The same options carrying an If-Match precondition.
Sourcepub fn if_none_match<S: Into<String>>(self, etag: S) -> Self
pub fn if_none_match<S: Into<String>>(self, etag: S) -> Self
The same options carrying an If-None-Match precondition.
Trait Implementations§
Source§impl Clone for RequestOptions
impl Clone for RequestOptions
Source§fn clone(&self) -> RequestOptions
fn clone(&self) -> RequestOptions
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 RequestOptions
impl Debug for RequestOptions
Source§impl Default for RequestOptions
impl Default for RequestOptions
Source§fn default() -> RequestOptions
fn default() -> RequestOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RequestOptions
impl RefUnwindSafe for RequestOptions
impl Send for RequestOptions
impl Sync for RequestOptions
impl Unpin for RequestOptions
impl UnsafeUnpin for RequestOptions
impl UnwindSafe for RequestOptions
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