Skip to main content

Module breakpoint

Module breakpoint 

Source
Expand description

Breakpoint matcher registration, callback WebSocket client, and handler routing.

This module provides the WebSocket callback stack for interactive breakpoints. It connects to /_mockserver_callback_websocket, obtains a clientId, and dispatches paused items to per-breakpoint-id handlers.

Modules§

phase
Breakpoint interception phase.

Structs§

BreakpointMatcherEntry
An entry in the list of registered breakpoint matchers.
BreakpointMatcherList
Response from listing breakpoint matchers.
BreakpointMatcherRegistration
Registration request for a breakpoint matcher.
BreakpointMatcherResponse
Response from registering a breakpoint matcher.
PausedStreamFrame
A paused stream frame pushed by the server over the callback WebSocket.
StreamFrameDecision
Client-to-server reply for a stream frame decision.
WsEnvelope

Functions§

extract_header
Extract the first value of a header from a JSON request object.
route_object_callback
Route an object-callback request frame to the registered closure.
route_request
Route a REQUEST-phase message: dispatch to the per-breakpoint-id handler, auto-continue on missing handler or panic. Returns (type_name, reply_value).
route_response
Route a RESPONSE-phase message: dispatch to the per-breakpoint-id handler, auto-continue on missing handler or panic. Returns (type_name, reply_value).
route_stream_frame
Route a stream-frame message: dispatch to the per-breakpoint-id handler, auto-continue on missing handler or panic. Returns (type_name, decision).
set_header
Set a header value on a JSON request/response object.

Type Aliases§

BreakpointRequestHandler
Handler for REQUEST phase breakpoints. Receives the parsed request JSON. Return a Value that is either:
BreakpointResponseHandler
Handler for RESPONSE phase breakpoints. Receives the request and response JSON objects. Return a response Value, or None to auto-continue.
BreakpointStreamFrameHandler
Handler for stream frame breakpoints. Receives the parsed PausedStreamFrame. Return a StreamFrameDecision, or None to auto-continue.
ObjectResponseHandler
Handler for object (closure) response callbacks.