VcrClient

Struct VcrClient 

Source
pub struct VcrClient { /* private fields */ }

Implementations§

Source§

impl VcrClient

Source

pub fn new( inner: Box<dyn HttpClient>, mode: VcrMode, cassette: Cassette, ) -> Self

Source

pub fn set_mode(&mut self, mode: VcrMode)

Source

pub fn set_matcher(&mut self, matcher: Box<dyn RequestMatcher>)

Source

pub fn set_filter_chain(&mut self, filter_chain: FilterChain)

Source

pub fn add_filter(&mut self, filter: Box<dyn Filter>)

Source

pub async fn save_cassette(&self) -> Result<(), Error>

Source

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

Source

pub async fn filter_and_save_cassette(&self) -> Result<(), Error>

Apply filters to all interactions in the cassette and save the filtered version

Source

pub fn builder<P: Into<PathBuf>>(cassette_path: P) -> VcrClientBuilder

Trait Implementations§

Source§

impl Debug for VcrClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for VcrClient

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

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,

Perform a request.
Source§

fn set_config(&mut self, config: Config) -> Result<(), Error>

Override the existing configuration with new configuration. Read more
Source§

fn config(&self) -> &Config

Get the current configuration.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,