pub struct FetchRule {
pub method: Option<String>,
pub url: UrlMatch,
pub status: u16,
pub headers: Vec<(String, String)>,
pub body: Vec<u8>,
pub times: Option<u32>,
pub error: Option<String>,
}Expand description
One canned answer for nitr.fetch.
Fields§
§method: Option<String>The method to match, uppercase; None matches any.
url: UrlMatchThe URL to match.
status: u16The status of the canned response.
headers: Vec<(String, String)>Its headers, in order.
body: Vec<u8>Its body.
times: Option<u32>How many requests it answers before falling through; None is
unlimited.
error: Option<String>A transport failure to raise instead of answering: the request fails the way a reset or a timeout would, and is retryable.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FetchRule
impl RefUnwindSafe for FetchRule
impl Send for FetchRule
impl Sync for FetchRule
impl Unpin for FetchRule
impl UnsafeUnpin for FetchRule
impl UnwindSafe for FetchRule
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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