Struct azure_core::ClientOptions
source · [−]pub struct ClientOptions {
pub timeout: TimeoutPolicy,
/* private fields */
}
Expand description
Client options allow customization of policies, retry options, and more.
Examples
You can override default options and even add your own per-call or per-retry policies:
use azure_core::{ClientOptions, ExponentialRetryOptions, RetryOptions, TelemetryOptions};
let options: ClientOptions = ClientOptions::default()
.retry(RetryOptions::exponential(ExponentialRetryOptions::default().max_retries(10u32)))
.telemetry(TelemetryOptions::default().application_id("my-application"));
Fields
timeout: TimeoutPolicy
Transport options.
Implementations
sourceimpl ClientOptions
impl ClientOptions
pub fn new(transport: TransportOptions) -> Self
sourcepub fn per_call_policies_mut(&mut self) -> &mut Vec<Arc<dyn Policy>>
pub fn per_call_policies_mut(&mut self) -> &mut Vec<Arc<dyn Policy>>
A mutable reference to per-call policies.
sourcepub fn per_retry_policies_mut(&mut self) -> &mut Vec<Arc<dyn Policy>>
pub fn per_retry_policies_mut(&mut self) -> &mut Vec<Arc<dyn Policy>>
A mutable reference to per-retry policies.
pub fn per_call_policies<P: Into<Vec<Arc<dyn Policy>>>>(
self,
per_call_policies: P
) -> Self
pub fn per_retry_policies<P: Into<Vec<Arc<dyn Policy>>>>(
self,
per_retry_policies: P
) -> Self
pub fn retry<P: Into<RetryOptions>>(self, retry: P) -> Self
pub fn telemetry<P: Into<TelemetryOptions>>(self, telemetry: P) -> Self
pub fn transport<P: Into<TransportOptions>>(self, transport: P) -> Self
pub fn timeout<P: Into<TimeoutPolicy>>(self, timeout: P) -> Self
Trait Implementations
sourceimpl Clone for ClientOptions
impl Clone for ClientOptions
sourcefn clone(&self) -> ClientOptions
fn clone(&self) -> ClientOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for ClientOptions
impl Debug for ClientOptions
sourceimpl Default for ClientOptions
impl Default for ClientOptions
sourcefn default() -> ClientOptions
fn default() -> ClientOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for ClientOptions
impl Send for ClientOptions
impl Sync for ClientOptions
impl Unpin for ClientOptions
impl !UnwindSafe for ClientOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more