mockserver_client/lib.rs
1//! # mockserver-client
2//!
3//! An idiomatic Rust client for [MockServer](https://www.mock-server.com)'s
4//! control-plane REST API.
5//!
6//! This crate provides a blocking (synchronous) client that communicates with a
7//! running MockServer instance over HTTP. It supports creating expectations,
8//! verifying requests, clearing/resetting state, and retrieving recorded data.
9//!
10//! # Quick Start
11//!
12//! ```no_run
13//! use mockserver_client::{ClientBuilder, HttpRequest, HttpResponse};
14//!
15//! let client = ClientBuilder::new("localhost", 1080).build().unwrap();
16//!
17//! client.when(HttpRequest::new().method("GET").path("/hello"))
18//! .respond(HttpResponse::new().status_code(200).body("world"))
19//! .unwrap();
20//!
21//! client.verify(
22//! HttpRequest::new().path("/hello"),
23//! mockserver_client::VerificationTimes::at_least(1),
24//! ).unwrap();
25//!
26//! client.reset().unwrap();
27//! ```
28
29mod model;
30mod client;
31mod error;
32pub mod breakpoint;
33pub mod launcher;
34pub mod llm;
35pub mod mcp;
36pub mod a2a;
37
38pub use client::{ClientBuilder, MockServerClient, ForwardChainExpectation, Scenario};
39pub use error::{Error, Result};
40pub use model::*;
41pub use breakpoint::{
42 phase, BreakpointMatcherRegistration, BreakpointMatcherResponse,
43 BreakpointMatcherEntry, BreakpointMatcherList, PausedStreamFrame,
44 StreamFrameDecision, WsEnvelope, BreakpointRequestHandler,
45 BreakpointResponseHandler, BreakpointStreamFrameHandler, ObjectResponseHandler,
46 extract_header, set_header,
47 route_request, route_object_callback, route_response, route_stream_frame,
48};