pub struct SystemOneConfig {
pub base_url: String,
pub api_key: Option<String>,
pub credentials: Option<Arc<dyn CredentialSource>>,
pub timeout: Duration,
pub max_request_bytes: usize,
pub max_response_bytes: usize,
pub headers: Vec<(String, String)>,
}Expand description
Client configuration.
Fields§
§base_url: String§api_key: Option<String>Static API key. Ignored when credentials is set.
credentials: Option<Arc<dyn CredentialSource>>Per-request credential source (e.g. a token broker on a phone).
timeout: DurationWhole-request timeout.
max_request_bytes: usizeRequest bodies above this size are rejected before sending (capped at 32 MiB).
max_response_bytes: usizeResponses above this size are rejected.
headers: Vec<(String, String)>Extra headers (e.g. a tenant header). Not sent when a credential moves the request to a different origin.
Implementations§
Source§impl SystemOneConfig
impl SystemOneConfig
Sourcepub fn with_api_key(api_key: impl Into<String>) -> Self
pub fn with_api_key(api_key: impl Into<String>) -> Self
Configuration with a static API key.
pub fn base_url(self, base_url: impl Into<String>) -> Self
pub fn credentials(self, source: Arc<dyn CredentialSource>) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Trait Implementations§
Source§impl Clone for SystemOneConfig
impl Clone for SystemOneConfig
Source§impl Debug for SystemOneConfig
impl Debug for SystemOneConfig
Auto Trait Implementations§
impl !RefUnwindSafe for SystemOneConfig
impl !UnwindSafe for SystemOneConfig
impl Forget for SystemOneConfig
impl Freeze for SystemOneConfig
impl Move for SystemOneConfig
impl Send for SystemOneConfig
impl Sync for SystemOneConfig
impl Unpin for SystemOneConfig
impl UnsafeUnpin for SystemOneConfig
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