Skip to main content

Module hook

Module hook 

Source
Expand description

Decide what happens to frames, objects, datagrams and streams.

ProxyHook is the decision surface: every method is synchronous, defaulted, and returns data describing what the engine should do — never a future, never a mutation performed in place. Timing is expressed as Action::Delay / Action::Hold and executed by the egress engine, where it is precise, attributable and bounded, so a hook can never stall a read loop.

Interest is the other half. It is sampled once, at session start, and decides which of the six methods are armed at all; Interest::NONE keeps all three forwarding paths on the zero-parse byte pump. The normative gating expression is mirrored in each method’s rustdoc below.

LegacyProxyHook and LegacyHook carry the 0.3.x Option<Vec<u8>> shape forward so existing implementations keep working while they migrate.

Structs§

FrameCtx
Context for a control message or datagram decision.
LegacyHook
Adapts a LegacyProxyHook to ProxyHook, preserving 0.3.x semantics exactly.
NoOpHook
A no-op hook that passes all frames through unchanged.
ObjectCtx
Context for an object decision.
StreamCtx
Context for a stream open, stream header, or stream end decision.

Traits§

LegacyProxyHookDeprecated
The 0.3.x hook shape, kept so existing implementations still compile.
ProxyHook
Decide what happens to frames, objects, datagrams and streams.