bare-types 0.3.0

A zero-cost foundation for type-safe domain modeling in Rust. Implements the 'Parse, don't validate' philosophy to eliminate primitive obsession and ensure data integrity at the system boundary.
Documentation
//! Example: URL parsing and manipulation with bare-types
#![allow(unused_crate_dependencies)]

use bare_types::net::{Port, Url};

fn main() {
    println!("=== bare-types URL demo ===\n");

    let url: Url =
        "https://user:pass@example.com:8080/path/to/resource?key=value&other=123#section"
            .parse()
            .expect("Valid URL");

    println!("Parsed URL: {}", url);

    println!("\nURL Components:");
    println!("  Scheme: {}", url.scheme());
    println!("  Host: {:?}", url.host());
    println!("  Port: {:?}", url.port());
    println!("  Path: {:?}", url.path());
    println!("  Query: {:?}", url.query());
    println!("  Fragment: {:?}", url.fragment());

    println!("\nPort Usage:");
    let https_port = Port::HTTPS;
    println!("  HTTPS port: {}", https_port);
    println!("  Is system port: {}", https_port.is_system_port());

    let custom_port: Port = 8080.try_into().expect("Valid port");
    println!("  Custom port: {}", custom_port);
    println!("  Is registered port: {}", custom_port.is_registered_port());

    println!("\nAll types are:");
    println!("  - Zero-cost abstractions");
    println!("  - Fully no_std compatible");
    println!("  - Type-safe with validation at construction");
    println!("  - RFC 3986 compliant");
}