pub struct RequestOptions {
pub timeout: Option<Duration>,
pub max_retries: Option<u32>,
pub idempotency_key: Option<String>,
pub extra_headers: Vec<(String, String)>,
pub extra_query: Vec<(String, String)>,
pub stream: Option<StreamOptions>,
}Expand description
Per-call overrides.
Rust has no default arguments, so rather than add an options parameter to
every generated method these are carried by a cheap clone of the client:
client.with_idempotency_key("order-4711").agents().create(&body).
Fields§
§timeout: Option<Duration>Overrides the client timeout for calls made through this clone.
max_retries: Option<u32>Overrides the client retry budget.
idempotency_key: Option<String>Reuse a specific key, e.g. to safely replay a create.
extra_headers: Vec<(String, String)>Headers added to every request.
extra_query: Vec<(String, String)>Query parameters added to every request.
stream: Option<StreamOptions>Reconnection behaviour for event streams.
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 !RefUnwindSafe for RequestOptions
impl !UnwindSafe for RequestOptions
impl Freeze for RequestOptions
impl Send for RequestOptions
impl Sync for RequestOptions
impl Unpin for RequestOptions
impl UnsafeUnpin 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