pub struct RegistryClientBuilder { /* private fields */ }Expand description
Builder for the non-default RegistryClient connection postures.
Start from RegistryClient::builder. The defaults match
RegistryClient::new exactly — the stronger SafeDnsResolver
DNS-hook posture (RFC-ACDP-0006 §7.6), the default SsrfPolicy,
and the RFC-ACDP-0006 §7.4 timeouts (5s connect, 30s total) — so a
bare builder(url).build().await is equivalent to new(url). Each
setter changes exactly one knob:
Self::pinned— pin-once resolution instead of the DNS hook.Self::ssrf_policy— a custom SSRF policy (e.g. a test policy).Self::root_cert_pem— trust an extra PEM root (private CA).Self::connect_timeout/Self::request_timeout— override the RFC default timeouts.
Implementations§
Source§impl RegistryClientBuilder
impl RegistryClientBuilder
Sourcepub fn pinned(self, pinned: bool) -> Self
pub fn pinned(self, pinned: bool) -> Self
Select pin-once resolution (RFC-ACDP-0006 §7.6): resolve the authority’s DNS a single time, validate that answer against the SSRF policy, and pin the connection to it. Weaker than the default DNS-hook posture (which re-validates every connection) — prefer the default unless you specifically need pin-once.
Sourcepub fn ssrf_policy(self, policy: SsrfPolicy) -> Self
pub fn ssrf_policy(self, policy: SsrfPolicy) -> Self
Override the SsrfPolicy applied to the base URL and to every
resolved IP. Defaults to SsrfPolicy::default.
Sourcepub fn root_cert_pem(self, pem: impl Into<Vec<u8>>) -> Self
pub fn root_cert_pem(self, pem: impl Into<Vec<u8>>) -> Self
Trust an additional PEM-encoded root certificate in addition to the system roots (e.g. a private/corporate CA).
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Override the connect timeout (default: RFC-ACDP-0006 §7.4, 5s).
Sourcepub fn request_timeout(self, timeout: Duration) -> Self
pub fn request_timeout(self, timeout: Duration) -> Self
Override the total request timeout (default: RFC-ACDP-0006 §7.4, 30s).
Sourcepub async fn build(self) -> Result<RegistryClient, AcdpError>
pub async fn build(self) -> Result<RegistryClient, AcdpError>
Build the RegistryClient.
Async because Self::pinned mode resolves DNS up front. The
default (DNS-hook) mode does no async work — it is constructed
synchronously internally.