Crate avx_http

Crate avx_http 

Source
Expand description

§avx-http - AVL Platform HTTP Client/Server

Native HTTP library optimized for Brazilian infrastructure and AVL Platform services.

§Features

  • High Performance: < 500µs request overhead, 100k+ req/s
  • Brazilian Optimized: Regional routing, smart retries
  • AVL Platform Native: Built-in auth, telemetry, AvilaDB integration
  • Developer Friendly: Simple async/await API

§Quick Start

§Client

use avx_http::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::builder()
        .build()?;

    let response = client
        .get("https://api.avila.cloud/data")
        .send()
        .await?;

    println!("Status: {}", response.status());
    Ok(())
}

§Server

use avx_http::{Server, Router, Response};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let router = Router::new()
        .get("/", || async { Response::text("Hello!") });

    Server::bind("0.0.0.0:3000")
        .router(router)
        .run()
        .await?;

    Ok(())
}

Re-exports§

pub use error::Error;
pub use error::Result;
pub use client::Client;
pub use client::ClientBuilder;
pub use client::Request;
pub use client::Response as ClientResponse;
pub use server::Server;
pub use server::Router;
pub use server::Response as ServerResponse;

Modules§

client
HTTP Client implementation
error
Error types for avx-http
server
HTTP Server implementation

Structs§

HeaderMap
A set of HTTP headers
HeaderValue
Represents an HTTP header field value.
Method
The Request Method (VERB)
StatusCode
An HTTP status code (status-code in RFC 9110 et al.).
Uri
The URI component of a request.

Constants§

VERSION
Library version