pub struct RequestOptions { /* private fields */ }Expand description
Per-call overrides applied on top of the client’s defaults.
Passed to the *_with method variants:
use std::time::Duration;
use openkind_client::{Client, RequestOptions, RetryPolicy};
let opts = RequestOptions::new()
.timeout(Duration::from_secs(2))
.retry(RetryPolicy::new().max_retries(0));
let _ = client.evaluate_with(request, &opts).await;Implementations§
Source§impl RequestOptions
impl RequestOptions
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Per-attempt timeout, overriding the client default.
Sourcepub fn retry(self, retry: RetryPolicy) -> Self
pub fn retry(self, retry: RetryPolicy) -> Self
Retry policy for this call, overriding the client default.
Sourcepub fn header(self, name: HeaderName, value: HeaderValue) -> Self
pub fn header(self, name: HeaderName, value: HeaderValue) -> Self
Extra header sent with this request only.
Trait Implementations§
Source§impl Clone for RequestOptions
impl Clone for RequestOptions
Source§impl Debug for RequestOptions
impl Debug for RequestOptions
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