pub struct HarRoute {
pub method: String,
pub pattern: String,
pub status: u16,
pub headers: Headers,
pub body: String,
}Expand description
A single HAR-derived route: the request signature to match against and the canned response to serve.
Constructed by routes_from_har; consumed by
BrowserContext::route_from_har /
Page::route_from_har, which turn each one
into a real route handler.
Fields§
§method: StringHTTP method (GET, POST, …), upper-cased for case-insensitive match.
pattern: StringURL glob (*-wildcarded, same semantics as route(pattern, …)).
status: u16HTTP status to fulfill with.
headers: HeadersResponse headers (lower-cased keys).
body: StringResponse body (already base64-decoded to a UTF-8 string when the HAR recorded it as base64; raw bytes that are not valid UTF-8 are passed through lossily — HAR replay is text-oriented in this crate).
Implementations§
Source§impl HarRoute
impl HarRoute
Sourcepub fn fulfill_options(&self) -> RouteFulfillOptions
pub fn fulfill_options(&self) -> RouteFulfillOptions
Build the RouteFulfillOptions that serves this canned response.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HarRoute
impl RefUnwindSafe for HarRoute
impl Send for HarRoute
impl Sync for HarRoute
impl Unpin for HarRoute
impl UnsafeUnpin for HarRoute
impl UnwindSafe for HarRoute
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