pub struct HttpForwardWithFallback {
pub http_forward: HttpForward,
pub fallback_response: HttpResponse,
pub fallback_on_status_codes: Option<Vec<i32>>,
pub fallback_on_timeout: Option<bool>,
pub delay: Option<Delay>,
pub primary: Option<bool>,
pub extra: Extra,
}Expand description
Forward action that falls back to a canned response when the upstream fails
(serialised as httpForwardWithFallback).
Fields§
§http_forward: HttpForward§fallback_response: HttpResponse§fallback_on_status_codes: Option<Vec<i32>>§fallback_on_timeout: Option<bool>§delay: Option<Delay>§primary: Option<bool>§extra: ExtraImplementations§
Source§impl HttpForwardWithFallback
impl HttpForwardWithFallback
Sourcepub fn new(http_forward: HttpForward, fallback_response: HttpResponse) -> Self
pub fn new(http_forward: HttpForward, fallback_response: HttpResponse) -> Self
Create a forward-with-fallback action.
Sourcepub fn fallback_on_status_codes(self, codes: Vec<i32>) -> Self
pub fn fallback_on_status_codes(self, codes: Vec<i32>) -> Self
Fall back when the upstream returns any of these status codes.
Sourcepub fn fallback_on_timeout(self, fallback: bool) -> Self
pub fn fallback_on_timeout(self, fallback: bool) -> Self
Fall back when the upstream request times out.
Trait Implementations§
Source§impl Clone for HttpForwardWithFallback
impl Clone for HttpForwardWithFallback
Source§fn clone(&self) -> HttpForwardWithFallback
fn clone(&self) -> HttpForwardWithFallback
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpForwardWithFallback
impl Debug for HttpForwardWithFallback
Source§impl<'de> Deserialize<'de> for HttpForwardWithFallback
impl<'de> Deserialize<'de> for HttpForwardWithFallback
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for HttpForwardWithFallback
impl PartialEq for HttpForwardWithFallback
Source§fn eq(&self, other: &HttpForwardWithFallback) -> bool
fn eq(&self, other: &HttpForwardWithFallback) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for HttpForwardWithFallback
impl Serialize for HttpForwardWithFallback
impl StructuralPartialEq for HttpForwardWithFallback
Auto Trait Implementations§
impl Freeze for HttpForwardWithFallback
impl RefUnwindSafe for HttpForwardWithFallback
impl Send for HttpForwardWithFallback
impl Sync for HttpForwardWithFallback
impl Unpin for HttpForwardWithFallback
impl UnsafeUnpin for HttpForwardWithFallback
impl UnwindSafe for HttpForwardWithFallback
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