net-cat 0.2.0

Minimal hand-rolled HTTP/1.1 client over std::net::TcpStream. Plain HTTP in v0; v0.2.0 adds an optional `tls` feature that wires rustls + webpki-roots Mozilla CA bundle so `https://` URLs work via the same `fetch` / `exchange` entry points. No external HTTP crate; framing and parsing are local. No `mut` beyond FFI carve-outs (`TcpStream::read_to_end`, rustls `Stream::new(&mut conn, &mut sock)`). Sixth sub-crate of a Servo-replacement webview runtime targeting Tauri.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! `fetch` -- the high-level entry point.

use crate::error::Error;
use crate::request::Request;
use crate::response::Response;
use crate::transport;

/// Execute `request` and return the parsed response.
///
/// # Errors
///
/// See [`Error`].  In particular, `https://` URLs return
/// [`Error::UnsupportedScheme`] in v0.
pub fn fetch(request: &Request) -> Result<Response, Error> {
    transport::exchange(request)
}