#[non_exhaustive]pub struct HttpFaultAbort {
pub http_status: Option<u32>,
pub percentage: Option<f64>,
/* private fields */
}Available on crate features
region-url-maps or url-maps only.Expand description
Specification for how requests are aborted as part of fault injection.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.http_status: Option<u32>The HTTP status code used to abort the request.
The value must be from 200 to 599 inclusive.
For gRPC protocol, the gRPC status code is mapped to HTTP status code according to this mapping table. HTTP status 200 is mapped to gRPC status UNKNOWN. Injecting an OK status is currently not supported by Traffic Director.
percentage: Option<f64>The percentage of traffic for connections, operations, or requests that is aborted as part of fault injection.
The value must be from 0.0 to 100.0 inclusive.
Implementations§
Source§impl HttpFaultAbort
impl HttpFaultAbort
pub fn new() -> Self
Sourcepub fn set_http_status<T>(self, v: T) -> Self
pub fn set_http_status<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_http_status<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_http_status<T>(self, v: Option<T>) -> Self
Sets or clears the value of http_status.
§Example
ⓘ
let x = HttpFaultAbort::new().set_or_clear_http_status(Some(42_u32));
let x = HttpFaultAbort::new().set_or_clear_http_status(None::<u32>);Sourcepub fn set_percentage<T>(self, v: T) -> Self
pub fn set_percentage<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_percentage<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_percentage<T>(self, v: Option<T>) -> Self
Sets or clears the value of percentage.
§Example
ⓘ
let x = HttpFaultAbort::new().set_or_clear_percentage(Some(42.0));
let x = HttpFaultAbort::new().set_or_clear_percentage(None::<f32>);Trait Implementations§
Source§impl Clone for HttpFaultAbort
impl Clone for HttpFaultAbort
Source§fn clone(&self) -> HttpFaultAbort
fn clone(&self) -> HttpFaultAbort
Returns a duplicate of the value. Read more
1.0.0 · 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 HttpFaultAbort
impl Debug for HttpFaultAbort
Source§impl Default for HttpFaultAbort
impl Default for HttpFaultAbort
Source§fn default() -> HttpFaultAbort
fn default() -> HttpFaultAbort
Returns the “default value” for a type. Read more
Source§impl Message for HttpFaultAbort
impl Message for HttpFaultAbort
Source§impl PartialEq for HttpFaultAbort
impl PartialEq for HttpFaultAbort
impl StructuralPartialEq for HttpFaultAbort
Auto Trait Implementations§
impl Freeze for HttpFaultAbort
impl RefUnwindSafe for HttpFaultAbort
impl Send for HttpFaultAbort
impl Sync for HttpFaultAbort
impl Unpin for HttpFaultAbort
impl UnwindSafe for HttpFaultAbort
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