Skip to main content

curl_fetch/
curl_fetch.rs

1//! Curl-only footprint fixture: links `eggup-acquisition` + `eggup-curl` only.
2//!
3//! This example exists to produce a comparable release binary proving that
4//! curl-only consumption does not require Eggfetch or an embedded HTTP/TLS
5//! stack. It performs no network I/O by default; it constructs the adapter
6//! from an explicit executable path and prints the redacted request.
7
8use eggup_acquisition::{AcquisitionRequest, FetchLimits};
9use eggup_curl::{discover_curl_executable, CurlConfig, CurlTransport};
10
11fn main() {
12    let exe = discover_curl_executable().unwrap_or_else(|_| "/usr/bin/curl".into());
13    let transport =
14        CurlTransport::with_executable(exe, CurlConfig::strict()).expect("curl transport");
15    let request = AcquisitionRequest::new("https://example.com/artifact").expect("request");
16    println!("curl executable: {}", transport.executable().display());
17    println!("request: {}", request.redacted());
18    println!("limits: {:?}", FetchLimits::default());
19}