pub struct ClientConfig { /* private fields */ }Expand description
Transport-level configuration for OAuth client operations
§Example
use std::time::Duration;
use volga_oauth_client::ClientConfig;
let config = ClientConfig::new()
.with_timeout(Duration::from_secs(5))
.with_max_redirects(0);
assert!(config.enforce_https());Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a configuration with the default policy: HTTPS enforced,
DEFAULT_TIMEOUT and DEFAULT_MAX_REDIRECTS
Sourcepub fn require_https(self, required: bool) -> Self
pub fn require_https(self, required: bool) -> Self
Controls whether plain http:// URLs are rejected
Enabled by default. Disable only for local development against a
plaintext authorization server; requests to http:// endpoints
otherwise fail with
ClientError::InsecureUrl.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sets the total timeout for a single request
Sourcepub fn with_max_redirects(self, max_redirects: u8) -> Self
pub fn with_max_redirects(self, max_redirects: u8) -> Self
Sets the maximum number of redirects followed per request;
0 disables redirects entirely
Sourcepub fn enforce_https(&self) -> bool
pub fn enforce_https(&self) -> bool
Returns whether plain http:// URLs are rejected
Sourcepub fn max_redirects(&self) -> u8
pub fn max_redirects(&self) -> u8
Returns the maximum number of redirects followed per request
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
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 ClientConfig
impl Debug for ClientConfig
Source§impl Default for ClientConfig
impl Default for ClientConfig
impl Eq for ClientConfig
Source§impl PartialEq for ClientConfig
impl PartialEq for ClientConfig
impl StructuralPartialEq for ClientConfig
Auto Trait Implementations§
impl Freeze for ClientConfig
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnsafeUnpin for ClientConfig
impl UnwindSafe for ClientConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.