Skip to main content

Crate pulse_http

Crate pulse_http 

Source
Expand description

Async HTTP/1.1 framework built on Tokio (no Hyper / Axum).

§Quick start

use pulse_http::{Request, Response, Router, Server};

#[tokio::main]
async fn main() {
    let router = Router::new().get("/health", |_req: Request| async {
        Response::ok("ok")
    });

    Server::bind("127.0.0.1:3000".into())
        .await
        .router(router)
        .serve()
        .await;
}

§Current scope

Included: keep-alive, Content-Length and chunked request bodies, routing, middleware, JSON, url-encoded forms, multipart form-data, streaming file responses, typed state, rate limits, CORS, read/write timeouts, graceful shutdown.

Re-exports§

pub use body::Body;
pub use errors::FormError;
pub use errors::MultipartError;
pub use headers::Headers;
pub use middleware::CatchPanic;
pub use middleware::Cors;
pub use middleware::Middleware;
pub use middleware::RequestId;
pub use middleware::RequestLogger;
pub use middleware::SecurityHeaders;
pub use rate_limit::Limit;
pub use rate_limit::RateLimit;
pub use request::Method;
pub use request::Request;
pub use response::Response;
pub use router::Handler;
pub use router::Router;
pub use server::Server;
pub use state::State;

Modules§

body
constants
errors
headers
middleware
rate_limit
request
response
router
server
state

Structs§

Multipart
MultipartFile

Functions§

parse_multipart
parse_urlencoded
Parses application/x-www-form-urlencoded text into key/value pairs. + becomes space; %XX is percent-decoded.