pub struct HarReplayHandler { /* private fields */ }Expand description
HAR replay handler that matches requests against HAR entries.
Implementations§
Source§impl HarReplayHandler
impl HarReplayHandler
Sourcepub async fn from_file(path: impl AsRef<Path>) -> Result<Self, NetworkError>
pub async fn from_file(path: impl AsRef<Path>) -> Result<Self, NetworkError>
Create a new HAR replay handler from a file path.
Sourcepub fn with_options(self, options: HarReplayOptions) -> Self
pub fn with_options(self, options: HarReplayOptions) -> Self
Set options for the handler.
Sourcepub fn find_entry(
&self,
url: &str,
method: &str,
post_data: Option<&str>,
) -> Option<&HarEntry>
pub fn find_entry( &self, url: &str, method: &str, post_data: Option<&str>, ) -> Option<&HarEntry>
Find a matching HAR entry for the given request.
Sourcepub fn build_response(&self, entry: &HarEntry) -> HarResponseData
pub fn build_response(&self, entry: &HarEntry) -> HarResponseData
Build a response from a HAR entry.
Sourcepub fn options(&self) -> &HarReplayOptions
pub fn options(&self) -> &HarReplayOptions
Get the options.
Sourcepub async fn record_entry(&self, entry: HarEntry)
pub async fn record_entry(&self, entry: HarEntry)
Record a new entry (for update mode).
Sourcepub async fn save_updates(&self) -> Result<(), NetworkError>
pub async fn save_updates(&self) -> Result<(), NetworkError>
Save updated HAR file (for update mode).
Auto Trait Implementations§
impl Freeze for HarReplayHandler
impl !RefUnwindSafe for HarReplayHandler
impl Send for HarReplayHandler
impl Sync for HarReplayHandler
impl Unpin for HarReplayHandler
impl !UnwindSafe for HarReplayHandler
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