Skip to main content

BackendServiceFailoverPolicy

Struct BackendServiceFailoverPolicy 

Source
#[non_exhaustive]
pub struct BackendServiceFailoverPolicy { pub disable_connection_drain_on_failover: Option<bool>, pub drop_traffic_if_unhealthy: Option<bool>, pub failover_ratio: Option<f32>, /* private fields */ }
Available on crate features backend-services or region-backend-services only.
Expand description

For load balancers that have configurable failover: Internal passthrough Network Load Balancers and external passthrough Network Load Balancers. On failover or failback, this field indicates whether connection draining will be honored. Google Cloud has a fixed connection draining timeout of 10 minutes. A setting of true terminates existing TCP connections to the active pool during failover and failback, immediately draining traffic. A setting of false allows existing TCP connections to persist, even on VMs no longer in the active pool, for up to the duration of the connection draining timeout (10 minutes).

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.
§disable_connection_drain_on_failover: Option<bool>

This can be set to true only if the protocol isTCP.

The default is false.

§drop_traffic_if_unhealthy: Option<bool>

If set to true, connections to the load balancer are dropped when all primary and all backup backend VMs are unhealthy.If set to false, connections are distributed among all primary VMs when all primary and all backup backend VMs are unhealthy. For load balancers that have configurable failover: Internal passthrough Network Load Balancers and external passthrough Network Load Balancers. The default is false.

§failover_ratio: Option<f32>

The value of the field must be in the range[0, 1]. If the value is 0, the load balancer performs a failover when the number of healthy primary VMs equals zero. For all other values, the load balancer performs a failover when the total number of healthy primary VMs is less than this ratio. For load balancers that have configurable failover: Internal TCP/UDP Load Balancing and external TCP/UDP Load Balancing.

Implementations§

Source§

impl BackendServiceFailoverPolicy

Source

pub fn new() -> Self

Source

pub fn set_disable_connection_drain_on_failover<T>(self, v: T) -> Self
where T: Into<bool>,

Sets the value of disable_connection_drain_on_failover.

§Example
let x = BackendServiceFailoverPolicy::new().set_disable_connection_drain_on_failover(true);
Source

pub fn set_or_clear_disable_connection_drain_on_failover<T>( self, v: Option<T>, ) -> Self
where T: Into<bool>,

Sets or clears the value of disable_connection_drain_on_failover.

§Example
let x = BackendServiceFailoverPolicy::new().set_or_clear_disable_connection_drain_on_failover(Some(false));
let x = BackendServiceFailoverPolicy::new().set_or_clear_disable_connection_drain_on_failover(None::<bool>);
Source

pub fn set_drop_traffic_if_unhealthy<T>(self, v: T) -> Self
where T: Into<bool>,

Sets the value of drop_traffic_if_unhealthy.

§Example
let x = BackendServiceFailoverPolicy::new().set_drop_traffic_if_unhealthy(true);
Source

pub fn set_or_clear_drop_traffic_if_unhealthy<T>(self, v: Option<T>) -> Self
where T: Into<bool>,

Sets or clears the value of drop_traffic_if_unhealthy.

§Example
let x = BackendServiceFailoverPolicy::new().set_or_clear_drop_traffic_if_unhealthy(Some(false));
let x = BackendServiceFailoverPolicy::new().set_or_clear_drop_traffic_if_unhealthy(None::<bool>);
Source

pub fn set_failover_ratio<T>(self, v: T) -> Self
where T: Into<f32>,

Sets the value of failover_ratio.

§Example
let x = BackendServiceFailoverPolicy::new().set_failover_ratio(42.0);
Source

pub fn set_or_clear_failover_ratio<T>(self, v: Option<T>) -> Self
where T: Into<f32>,

Sets or clears the value of failover_ratio.

§Example
let x = BackendServiceFailoverPolicy::new().set_or_clear_failover_ratio(Some(42.0));
let x = BackendServiceFailoverPolicy::new().set_or_clear_failover_ratio(None::<f32>);

Trait Implementations§

Source§

impl Clone for BackendServiceFailoverPolicy

Source§

fn clone(&self) -> BackendServiceFailoverPolicy

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BackendServiceFailoverPolicy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BackendServiceFailoverPolicy

Source§

fn default() -> BackendServiceFailoverPolicy

Returns the “default value” for a type. Read more
Source§

impl Message for BackendServiceFailoverPolicy

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for BackendServiceFailoverPolicy

Source§

fn eq(&self, other: &BackendServiceFailoverPolicy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for BackendServiceFailoverPolicy

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,