pub struct ClientOptions {
pub api_key: String,
pub base_url: String,
pub max_attempts: u32,
pub backoff_ms: u64,
pub timeout_ms: u64,
}Expand description
Options for constructing a Client.
There is no environment-variable fallback by design — the API key and base URL are always explicit constructor arguments.
Fields§
§api_key: String§base_url: String§max_attempts: u32Total attempts per request (including the first). Default 2.
backoff_ms: u64Fixed delay between attempts. Default 500ms.
timeout_ms: u64Per-request timeout. Default 90000ms.
Implementations§
Source§impl ClientOptions
impl ClientOptions
Sourcepub fn new(api_key: impl Into<String>, base_url: impl Into<String>) -> Self
pub fn new(api_key: impl Into<String>, base_url: impl Into<String>) -> Self
Point the client at an explicit base URL (staging / self-hosted gateway).
Sourcepub fn for_region(api_key: impl Into<String>, region: SolariRegion) -> Self
pub fn for_region(api_key: impl Into<String>, region: SolariRegion) -> Self
Point the client at a region’s public API. SolariRegion::UsWest
resolves to https://api.getsolari.com.
Sourcepub fn default_region(api_key: impl Into<String>) -> Self
pub fn default_region(api_key: impl Into<String>) -> Self
Point the client at the default region (us-west).
pub fn max_attempts(self, n: u32) -> Self
pub fn backoff_ms(self, ms: u64) -> Self
pub fn timeout_ms(self, ms: u64) -> Self
Trait Implementations§
Source§impl Clone for ClientOptions
impl Clone for ClientOptions
Auto Trait Implementations§
impl Forget for ClientOptions
impl Freeze for ClientOptions
impl Move for ClientOptions
impl RefUnwindSafe for ClientOptions
impl Send for ClientOptions
impl Sync for ClientOptions
impl Unpin for ClientOptions
impl UnsafeUnpin for ClientOptions
impl UnwindSafe for ClientOptions
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