powhttp_sdk/lib.rs
1//! Official SDK for building powhttp extensions in Rust.
2//!
3//! An extension is started via [`run`], which provides an [`ExtensionHandle`] for
4//! interacting with powhttp by registering context-menu items, overview
5//! fields, inspector tabs, connect handlers and querying session data.
6//!
7//! # Quick start
8//!
9//! ```rust,no_run
10//! use powhttp_sdk::{run, Error, ExtensionHandle};
11//!
12//! #[tokio::main]
13//! async fn main() -> Result<(), Error> {
14//! run(async |handle: ExtensionHandle| {
15//! // register handlers, query sessions, etc.
16//! Ok(())
17//! }).await
18//! }
19//! ```
20
21mod error;
22mod runtime;
23mod serde_helpers;
24
25/// TLS record-layer messages.
26pub mod tls;
27/// HTTP/2 frames.
28pub mod http2;
29/// WebSocket messages.
30pub mod websocket;
31/// Session entries and related data types (requests, responses, headers, timings).
32pub mod sessions;
33/// Proxy server connection handling and upstream proxy configuration.
34pub mod proxy_server;
35/// Context-menu items and submenus for single and multi-entry selections.
36pub mod context_menu;
37/// Overview fields and sections.
38pub mod overview;
39/// Request and response tabs displayed in the Inspector.
40pub mod inspector;
41/// Small shared types used across multiple modules.
42pub mod shared;
43
44pub use runtime::run;
45pub use error::Error;
46pub use runtime::handle::ExtensionHandle;
47pub use runtime::handlers::{SingleEntryContext, MultiEntryContext};
48pub use overview::{OverviewField, OverviewSection};
49pub use inspector::{Language, MessageTab, TabContent};
50pub use context_menu::{
51 ContextMenuItemSingle,
52 ContextMenuItemMulti,
53 ContextMenuSubmenuSingle,
54 ContextMenuSubmenuMulti
55};
56pub use sessions::Headers;