Struct GraphClientConfiguration

Source
pub struct GraphClientConfiguration { /* private fields */ }

Implementations§

Source§

impl GraphClientConfiguration

Source

pub fn new() -> GraphClientConfiguration

Source

pub fn access_token<AT: ToString>( self, access_token: AT, ) -> GraphClientConfiguration

Source

pub fn client_application<CA: ClientApplication + 'static>( self, client_app: CA, ) -> Self

Source

pub fn default_headers(self, headers: HeaderMap) -> GraphClientConfiguration

Source

pub fn referer(self, enable: bool) -> GraphClientConfiguration

Enable or disable automatic setting of the Referer header.

Default is true.

Source

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.

Source

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.

Source

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.

Source

pub fn user_agent(self, value: HeaderValue) -> GraphClientConfiguration

Source

pub fn min_tls_version(self, version: Version) -> GraphClientConfiguration

TLS 1.2 required to support all features in Microsoft Graph See Reliability and Support

Source

pub fn proxy(self, proxy: Proxy) -> GraphClientConfiguration

Set Proxy for all network operations.

Default is no proxy.

Source

pub fn https_only(self, https_only: bool) -> GraphClientConfiguration

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> GraphClientConfiguration

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GraphClientConfiguration

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GraphClientConfiguration

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<GraphClientConfiguration> for Client

Source§

fn from(value: GraphClientConfiguration) -> Self

Converts to this type from the input type.
Source§

impl From<GraphClientConfiguration> for MinimalAsyncClient

Source§

fn from(value: GraphClientConfiguration) -> Self

Converts to this type from the input type.
Source§

impl From<GraphClientConfiguration> for MinimalBlockingClient

Source§

fn from(value: GraphClientConfiguration) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for GraphClientConfiguration

Source§

fn eq(&self, other: &GraphClientConfiguration) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for GraphClientConfiguration

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T