pub struct GraphClientConfiguration { /* private fields */ }
Implementations§
Source§impl GraphClientConfiguration
impl GraphClientConfiguration
pub fn new() -> GraphClientConfiguration
pub fn access_token<AT: ToString>( self, access_token: AT, ) -> GraphClientConfiguration
pub fn client_application<CA: ClientApplication + 'static>( self, client_app: CA, ) -> Self
pub fn default_headers(self, headers: HeaderMap) -> GraphClientConfiguration
Sourcepub fn referer(self, enable: bool) -> GraphClientConfiguration
pub fn referer(self, enable: bool) -> GraphClientConfiguration
Enable or disable automatic setting of the Referer
header.
Default is true
.
Sourcepub fn timeout(self, timeout: Duration) -> GraphClientConfiguration
pub fn timeout(self, timeout: Duration) -> GraphClientConfiguration
Enables a request timeout.
The timeout is applied from when the request starts connecting until the response body has finished.
Default is no timeout.
Sourcepub fn connect_timeout(self, timeout: Duration) -> GraphClientConfiguration
pub fn connect_timeout(self, timeout: Duration) -> GraphClientConfiguration
Set a timeout for only the connect phase of a Client
.
Default is None
.
§Note
This requires the futures be executed in a tokio runtime with a tokio timer enabled.
Sourcepub fn connection_verbose(self, verbose: bool) -> GraphClientConfiguration
pub fn connection_verbose(self, verbose: bool) -> GraphClientConfiguration
Set whether connections should emit verbose logs.
Enabling this option will emit log messages at the TRACE
level
for read and write operations on connections.
pub fn user_agent(self, value: HeaderValue) -> GraphClientConfiguration
Sourcepub fn min_tls_version(self, version: Version) -> GraphClientConfiguration
pub fn min_tls_version(self, version: Version) -> GraphClientConfiguration
TLS 1.2 required to support all features in Microsoft Graph See Reliability and Support
Sourcepub fn proxy(self, proxy: Proxy) -> GraphClientConfiguration
pub fn proxy(self, proxy: Proxy) -> GraphClientConfiguration
Set Proxy
for all network operations.
Default is no proxy.
pub fn https_only(self, https_only: bool) -> GraphClientConfiguration
Sourcepub fn retry(self, retry: Option<usize>) -> GraphClientConfiguration
pub fn retry(self, retry: Option<usize>) -> GraphClientConfiguration
Enable a request retry for a failed request. The retry parameter can be used to change how many times the request should be retried.
Some requests may fail on GraphAPI side and should be retried. Only server errors (HTTP code between 500 and 599) will be retried.
Default is no retry.
Sourcepub fn wait_for_retry_after_headers(
self,
retry: bool,
) -> GraphClientConfiguration
pub fn wait_for_retry_after_headers( self, retry: bool, ) -> GraphClientConfiguration
Enable a request retry if we reach the throttling limits and GraphAPI returns a 429 Too Many Requests with a Retry-After header
Retry attempts are executed when the response has a status code of 429, 500, 503, 504 and the response has a Retry-After header. The Retry-After header provides a back-off time to wait for before retrying the request again.
Be careful with this parameter as some API endpoints have quite low limits (reports for example) and the request may hang for hundreds of seconds. For maximum throughput you may want to not respect the Retry-After header as hitting another server thanks to load-balancing may lead to a successful response.
Default is no retry.
Sourcepub fn concurrency_limit(
self,
concurrency_limit: Option<usize>,
) -> GraphClientConfiguration
pub fn concurrency_limit( self, concurrency_limit: Option<usize>, ) -> GraphClientConfiguration
Enable a concurrency limit on the client.
Every request through this client will be subject to a concurrency limit. Can be useful to stay under the API limits set by GraphAPI.
Default is no concurrency limit.
Trait Implementations§
Source§impl Clone for GraphClientConfiguration
impl Clone for GraphClientConfiguration
Source§fn clone(&self) -> GraphClientConfiguration
fn clone(&self) -> GraphClientConfiguration
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for GraphClientConfiguration
impl Debug for GraphClientConfiguration
Source§impl Default for GraphClientConfiguration
impl Default for GraphClientConfiguration
Source§impl From<GraphClientConfiguration> for Client
impl From<GraphClientConfiguration> for Client
Source§fn from(value: GraphClientConfiguration) -> Self
fn from(value: GraphClientConfiguration) -> Self
Source§impl From<GraphClientConfiguration> for MinimalAsyncClient
impl From<GraphClientConfiguration> for MinimalAsyncClient
Source§fn from(value: GraphClientConfiguration) -> Self
fn from(value: GraphClientConfiguration) -> Self
Source§impl From<GraphClientConfiguration> for MinimalBlockingClient
impl From<GraphClientConfiguration> for MinimalBlockingClient
Source§fn from(value: GraphClientConfiguration) -> Self
fn from(value: GraphClientConfiguration) -> Self
Source§impl PartialEq for GraphClientConfiguration
impl PartialEq for GraphClientConfiguration
impl StructuralPartialEq for GraphClientConfiguration
Auto Trait Implementations§
impl !Freeze for GraphClientConfiguration
impl !RefUnwindSafe for GraphClientConfiguration
impl Send for GraphClientConfiguration
impl Sync for GraphClientConfiguration
impl Unpin for GraphClientConfiguration
impl !UnwindSafe for GraphClientConfiguration
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more