#[non_exhaustive]pub struct LivenessCheck {
pub path: String,
pub host: String,
pub failure_threshold: u32,
pub success_threshold: u32,
pub check_interval: Option<Duration>,
pub timeout: Option<Duration>,
pub initial_delay: Option<Duration>,
/* private fields */
}Expand description
Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances.
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.path: StringThe request path.
host: StringHost header to send when performing a HTTP Liveness check. Example: “myapp.appspot.com”
failure_threshold: u32Number of consecutive failed checks required before considering the VM unhealthy.
success_threshold: u32Number of consecutive successful checks required before considering the VM healthy.
check_interval: Option<Duration>Interval between health checks.
timeout: Option<Duration>Time before the check is considered failed.
initial_delay: Option<Duration>The initial delay before starting to execute the checks.
Implementations§
Source§impl LivenessCheck
impl LivenessCheck
pub fn new() -> Self
Sourcepub fn set_failure_threshold<T: Into<u32>>(self, v: T) -> Self
pub fn set_failure_threshold<T: Into<u32>>(self, v: T) -> Self
Sets the value of failure_threshold.
§Example
ⓘ
let x = LivenessCheck::new().set_failure_threshold(42_u32);Sourcepub fn set_success_threshold<T: Into<u32>>(self, v: T) -> Self
pub fn set_success_threshold<T: Into<u32>>(self, v: T) -> Self
Sets the value of success_threshold.
§Example
ⓘ
let x = LivenessCheck::new().set_success_threshold(42_u32);Sourcepub fn set_check_interval<T>(self, v: T) -> Self
pub fn set_check_interval<T>(self, v: T) -> Self
Sets the value of check_interval.
§Example
ⓘ
use wkt::Duration;
let x = LivenessCheck::new().set_check_interval(Duration::default()/* use setters */);Sourcepub fn set_or_clear_check_interval<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_check_interval<T>(self, v: Option<T>) -> Self
Sets or clears the value of check_interval.
§Example
ⓘ
use wkt::Duration;
let x = LivenessCheck::new().set_or_clear_check_interval(Some(Duration::default()/* use setters */));
let x = LivenessCheck::new().set_or_clear_check_interval(None::<Duration>);Sourcepub fn set_timeout<T>(self, v: T) -> Self
pub fn set_timeout<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_timeout<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_timeout<T>(self, v: Option<T>) -> Self
Sourcepub fn set_initial_delay<T>(self, v: T) -> Self
pub fn set_initial_delay<T>(self, v: T) -> Self
Sets the value of initial_delay.
§Example
ⓘ
use wkt::Duration;
let x = LivenessCheck::new().set_initial_delay(Duration::default()/* use setters */);Sourcepub fn set_or_clear_initial_delay<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_initial_delay<T>(self, v: Option<T>) -> Self
Sets or clears the value of initial_delay.
§Example
ⓘ
use wkt::Duration;
let x = LivenessCheck::new().set_or_clear_initial_delay(Some(Duration::default()/* use setters */));
let x = LivenessCheck::new().set_or_clear_initial_delay(None::<Duration>);Trait Implementations§
Source§impl Clone for LivenessCheck
impl Clone for LivenessCheck
Source§fn clone(&self) -> LivenessCheck
fn clone(&self) -> LivenessCheck
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 LivenessCheck
impl Debug for LivenessCheck
Source§impl Default for LivenessCheck
impl Default for LivenessCheck
Source§fn default() -> LivenessCheck
fn default() -> LivenessCheck
Returns the “default value” for a type. Read more
Source§impl Message for LivenessCheck
impl Message for LivenessCheck
Source§impl PartialEq for LivenessCheck
impl PartialEq for LivenessCheck
impl StructuralPartialEq for LivenessCheck
Auto Trait Implementations§
impl Freeze for LivenessCheck
impl RefUnwindSafe for LivenessCheck
impl Send for LivenessCheck
impl Sync for LivenessCheck
impl Unpin for LivenessCheck
impl UnwindSafe for LivenessCheck
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