pub struct ShieldClientOptions { /* private fields */ }Expand description
Configuration for ShieldClient.
use highflame_shield::ShieldClientOptions;
use std::time::Duration;
let opts = ShieldClientOptions::new("hf_sk_my_key")
.base_url("https://shield.self-hosted.example.com")
.timeout(Duration::from_secs(10))
.max_retries(1);Implementations§
Source§impl ShieldClientOptions
impl ShieldClientOptions
Sourcepub fn new(api_key: impl Into<String>) -> Self
pub fn new(api_key: impl Into<String>) -> Self
Create options from just an API key; all other fields take defaults.
Sourcepub fn base_url(self, url: impl Into<String>) -> Self
pub fn base_url(self, url: impl Into<String>) -> Self
Override the guard service base URL (default: Highflame SaaS endpoint).
Sourcepub fn token_url(self, url: impl Into<String>) -> Self
pub fn token_url(self, url: impl Into<String>) -> Self
Override the token exchange URL (default: Highflame SaaS endpoint).
Only used when api_key starts with hf_sk.
Sourcepub fn max_retries(self, n: u32) -> Self
pub fn max_retries(self, n: u32) -> Self
Number of retries on 429 / 5xx (default: 2).
Sourcepub fn account_id(self, id: impl Into<String>) -> Self
pub fn account_id(self, id: impl Into<String>) -> Self
Override X-Account-ID header; takes precedence over the token exchange
value.
Sourcepub fn project_id(self, id: impl Into<String>) -> Self
pub fn project_id(self, id: impl Into<String>) -> Self
Override X-Project-ID header; takes precedence over the token exchange
value.
Trait Implementations§
Source§impl Clone for ShieldClientOptions
impl Clone for ShieldClientOptions
Source§fn clone(&self) -> ShieldClientOptions
fn clone(&self) -> ShieldClientOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ShieldClientOptions
impl RefUnwindSafe for ShieldClientOptions
impl Send for ShieldClientOptions
impl Sync for ShieldClientOptions
impl Unpin for ShieldClientOptions
impl UnsafeUnpin for ShieldClientOptions
impl UnwindSafe for ShieldClientOptions
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