pub struct DepsDevClient { /* private fields */ }Expand description
Assembles SupplyChainTrustSignals from deps.dev’s two-call sequence.
Layers its own TTL memo over HttpCache’s reused transport — see the module
docs for the caching/failure-handling rationale.
Implementations§
Source§impl DepsDevClient
impl DepsDevClient
Sourcepub fn new(cache: Arc<HttpCache>) -> Self
pub fn new(cache: Arc<HttpCache>) -> Self
Creates a client that reuses cache’s HTTP transport for both
deps.dev calls, pointed at the real deps.dev API.
Sourcepub fn for_test(cache: Arc<HttpCache>, base_url: impl Into<String>) -> Self
pub fn for_test(cache: Arc<HttpCache>, base_url: impl Into<String>) -> Self
Creates a client pointed at base_url instead of the real deps.dev
API, for mockito-backed tests.
Sourcepub async fn trust_signal(
&self,
system: &'static str,
name: &str,
version: &str,
) -> Option<SupplyChainTrustSignal>
pub async fn trust_signal( &self, system: &'static str, name: &str, version: &str, ) -> Option<SupplyChainTrustSignal>
Returns the supply-chain trust signal for one resolved
(system, name, version), or None when nothing is available to
render.
Infallible by construction (FR-006) — every failure degrades to
None, memoized under the short error TTL so a transient outage
does not re-fire on every hover. A call for a key another concurrent
call is already fetching returns None immediately rather than
duplicating the fetch (N1) — the caller’s own memo read on its next
call picks up the result once the in-flight fetch completes and
writes it.
Trait Implementations§
Source§impl Debug for DepsDevClient
Manual, non-exhaustive impl: VersionData derives Debug and holds this behind
Option<&Arc<DepsDevClient>>, but the memo maps’ entry types have no reason to
derive Debug of their own.
impl Debug for DepsDevClient
Manual, non-exhaustive impl: VersionData derives Debug and holds this behind
Option<&Arc<DepsDevClient>>, but the memo maps’ entry types have no reason to
derive Debug of their own.