pub struct VcrClient { /* private fields */ }Expand description
VCR client for HTTP request interception
Implementations§
Source§impl VcrClient
impl VcrClient
Sourcepub fn new(mode: VcrMode, cassette_dir: PathBuf) -> Self
pub fn new(mode: VcrMode, cassette_dir: PathBuf) -> Self
Create a new VCR client with explicit mode and directory
Sourcepub fn with_scrub_config(self, config: ScrubConfig) -> Self
pub fn with_scrub_config(self, config: ScrubConfig) -> Self
Set custom scrub configuration
Sourcepub fn fingerprint(method: &str, url: &str, body: Option<&Value>) -> String
pub fn fingerprint(method: &str, url: &str, body: Option<&Value>) -> String
Compute fingerprint for request matching using JCS (RFC 8785)
Fingerprint includes: method + URL + canonical body (excluding auth)
Sourcepub async fn post_json(
&mut self,
url: &str,
body: &Value,
auth_header: Option<&str>,
) -> Result<VcrResponse>
pub async fn post_json( &mut self, url: &str, body: &Value, auth_header: Option<&str>, ) -> Result<VcrResponse>
Make a POST request with VCR handling
Sourcepub fn cassette_count(&self) -> usize
pub fn cassette_count(&self) -> usize
Get cassette count (for diagnostics)
Auto Trait Implementations§
impl !RefUnwindSafe for VcrClient
impl !UnwindSafe for VcrClient
impl Freeze for VcrClient
impl Send for VcrClient
impl Sync for VcrClient
impl Unpin for VcrClient
impl UnsafeUnpin for VcrClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more