Skip to main content

actus_reply/
lib.rs

1//! Response types and the `reply!` macro for the Actus framework.
2#![warn(missing_docs)]
3
4pub mod finalizer;
5pub mod reply;
6
7pub use finalizer::Finalizer;
8pub use reply::{
9    BodyStream, ProblemDetails, Reply, ReplyData, ReplySpec, SseEvent, WebError, build_reply,
10    bytes, empty, json, sse, stream, try_json,
11};
12
13/// Convenience prelude for downstream crates and applications.
14pub mod prelude {
15    pub use crate::reply;
16    pub use crate::reply::{
17        BodyStream, ProblemDetails, Reply, ReplyData, ReplySpec, SseEvent, WebError, build_reply,
18        bytes, empty, json, sse, stream, try_json,
19    };
20    // HTTP status codes show up in handlers (`reply!(status = …, body)`,
21    // `ProblemDetails::new(StatusCode::FORBIDDEN, …)`, etc.), so include
22    // them in the prelude rather than make every consumer import `http`.
23    pub use http::StatusCode;
24}