Skip to main content

cassetter/
lib.rs

1//! Async HTTP and gRPC recording and replay for Rust.
2//!
3//! [`Recorder`] owns one cassette lifecycle. Inject [`reqwest::Client`] or
4//! [`tonic::GrpcService`] explicitly into the client under test, then call
5//! [`Recorder::finish`] so persistence and incomplete recordings cannot be
6//! silently ignored.
7
8#[cfg(feature = "reqwest")]
9mod compare;
10mod config;
11mod error;
12mod recorder;
13mod recorder_state;
14#[cfg(feature = "reqwest")]
15mod reqwest_body;
16#[cfg(feature = "tonic")]
17mod tonic_body;
18#[cfg(feature = "tonic")]
19mod tonic_metadata;
20
21#[cfg(feature = "reqwest")]
22pub mod reqwest;
23#[cfg(feature = "tonic")]
24pub mod tonic;
25
26#[cfg(feature = "reqwest")]
27pub use cassetter_core::protocol::http::HttpResponse;
28#[cfg(feature = "reqwest")]
29pub use compare::Compare;
30pub use config::{RecordMode, RecorderBuilder};
31pub use error::{Error, Result};
32pub use recorder::Recorder;
33#[cfg(feature = "reqwest")]
34pub use reqwest::Client as ReqwestClient;
35#[cfg(feature = "tonic")]
36pub use tonic::GrpcService;