Skip to main content

Crate powhttp_sdk

Crate powhttp_sdk 

Source
Expand description

Official SDK for building powhttp extensions in Rust.

An extension is started via run, which provides an ExtensionHandle for interacting with powhttp by registering context-menu items, overview fields, inspector tabs, connect handlers and querying session data.

§Quick start

use powhttp_sdk::{run, Error, ExtensionHandle};

#[tokio::main]
async fn main() -> Result<(), Error> {
    run(async |handle: ExtensionHandle| {
        // register handlers, query sessions, etc.
        Ok(())
    }).await
}

Re-exports§

pub use overview::OverviewField;
pub use overview::OverviewSection;
pub use inspector::Language;
pub use inspector::MessageTab;
pub use inspector::TabContent;
pub use context_menu::ContextMenuItemSingle;
pub use context_menu::ContextMenuItemMulti;
pub use context_menu::ContextMenuSubmenuSingle;
pub use context_menu::ContextMenuSubmenuMulti;
pub use sessions::Headers;

Modules§

context_menu
Context-menu items and submenus for single and multi-entry selections.
http2
HTTP/2 frames.
inspector
Request and response tabs displayed in the Inspector.
overview
Overview fields and sections.
proxy_server
Proxy server connection handling and upstream proxy configuration.
sessions
Session entries and related data types (requests, responses, headers, timings).
shared
Small shared types used across multiple modules.
tls
TLS record-layer messages.
websocket
WebSocket messages.

Structs§

ExtensionHandle
Handle used to communicate with powhttp.
MultiEntryContext
Context provided to handlers that operate on multiple session entries at once.
SingleEntryContext
Context provided to handlers that operate on a single session entry.

Enums§

Error
Error type returned by extension handlers and SDK operations.

Functions§

run
Starts the extension runtime, calling init with an ExtensionHandle.