pub struct SentinelClient {
pub token: String,
pub api_base: String,
pub agent: Agent,
}Expand description
A configured HTTP client for the Sentinel API.
Constructed only when SENTINEL_API_TOKEN is present; every call site
gates on Option<SentinelClient> so no HTTP is attempted without a token.
Fields§
§token: String§api_base: String§agent: AgentImplementations§
Source§impl SentinelClient
impl SentinelClient
Sourcepub fn from_env() -> Option<Self>
pub fn from_env() -> Option<Self>
Return Some(SentinelClient) when SENTINEL_API_TOKEN is set in the
environment, otherwise None.
SENTINEL_API_URL overrides the default API base URL.
Sourcepub fn new_upload_agent() -> Agent
pub fn new_upload_agent() -> Agent
HTTP agent for the background S3 upload loop.
Like Self::from_env’s agent, this uses per-phase timeouts only (no
timeout_global) so ureq’s DNS resolver stays synchronous and does not
spawn a helper thread per lookup. Upload-specific bounds differ from the
API agent’s because S3 PUTs can transfer larger payloads.
Trait Implementations§
Source§impl Clone for SentinelClient
impl Clone for SentinelClient
Source§fn clone(&self) -> SentinelClient
fn clone(&self) -> SentinelClient
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 SentinelClient
impl !RefUnwindSafe for SentinelClient
impl Send for SentinelClient
impl Sync for SentinelClient
impl Unpin for SentinelClient
impl UnsafeUnpin for SentinelClient
impl !UnwindSafe for SentinelClient
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