pub struct VcrClient { /* private fields */ }Implementations§
Source§impl VcrClient
impl VcrClient
pub fn new( inner: Box<dyn HttpClient>, mode: VcrMode, cassette: Cassette, ) -> Self
pub fn set_mode(&mut self, mode: VcrMode)
pub fn set_matcher(&mut self, matcher: Box<dyn RequestMatcher>)
pub fn set_filter_chain(&mut self, filter_chain: FilterChain)
pub fn add_filter(&mut self, filter: Box<dyn Filter>)
pub async fn save_cassette(&self) -> Result<(), Error>
Sourcepub async fn apply_filters_to_cassette(&self) -> Result<(), Error>
pub async fn apply_filters_to_cassette(&self) -> Result<(), Error>
Apply filters to all interactions in the cassette This modifies the cassette in-place by applying the configured filter chain to all interactions
Sourcepub async fn filter_and_save_cassette(&self) -> Result<(), Error>
pub async fn filter_and_save_cassette(&self) -> Result<(), Error>
Apply filters to all interactions in the cassette and save the filtered version
pub fn builder<P: Into<PathBuf>>(cassette_path: P) -> VcrClientBuilder
Trait Implementations§
Source§impl HttpClient for VcrClient
impl HttpClient for VcrClient
Source§fn send<'life0, 'async_trait>(
&'life0 self,
req: Request,
) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 self,
req: Request,
) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Perform a request.
Auto Trait Implementations§
impl Freeze for VcrClient
impl !RefUnwindSafe for VcrClient
impl Send for VcrClient
impl Sync for VcrClient
impl Unpin for VcrClient
impl !UnwindSafe 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