#[non_exhaustive]pub struct ConsistentHashLoadBalancerSettings {
pub http_cookie: Option<ConsistentHashLoadBalancerSettingsHttpCookie>,
pub http_header_name: Option<String>,
pub minimum_ring_size: Option<i64>,
/* private fields */
}backend-services or region-backend-services only.Expand description
This message defines settings for a consistent hash style load balancer.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.Hash is based on HTTP Cookie. This field describes a HTTP cookie that will be used as the hash key for the consistent hash load balancer. If the cookie is not present, it will be generated. This field is applicable if the sessionAffinity is set to HTTP_COOKIE.
Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
http_header_name: Option<String>The hash based on the value of the specified header field. This field is applicable if the sessionAffinity is set toHEADER_FIELD.
minimum_ring_size: Option<i64>The minimum number of virtual nodes to use for the hash ring. Defaults to 1024. Larger ring sizes result in more granular load distributions. If the number of hosts in the load balancing pool is larger than the ring size, each host will be assigned a single virtual node.
Implementations§
Source§impl ConsistentHashLoadBalancerSettings
impl ConsistentHashLoadBalancerSettings
pub fn new() -> Self
Sets the value of http_cookie.
§Example
use google_cloud_compute_v1::model::ConsistentHashLoadBalancerSettingsHttpCookie;
let x = ConsistentHashLoadBalancerSettings::new().set_http_cookie(ConsistentHashLoadBalancerSettingsHttpCookie::default()/* use setters */);Sets or clears the value of http_cookie.
§Example
use google_cloud_compute_v1::model::ConsistentHashLoadBalancerSettingsHttpCookie;
let x = ConsistentHashLoadBalancerSettings::new().set_or_clear_http_cookie(Some(ConsistentHashLoadBalancerSettingsHttpCookie::default()/* use setters */));
let x = ConsistentHashLoadBalancerSettings::new().set_or_clear_http_cookie(None::<ConsistentHashLoadBalancerSettingsHttpCookie>);Sourcepub fn set_http_header_name<T>(self, v: T) -> Self
pub fn set_http_header_name<T>(self, v: T) -> Self
Sets the value of http_header_name.
§Example
let x = ConsistentHashLoadBalancerSettings::new().set_http_header_name("example");Sourcepub fn set_or_clear_http_header_name<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_http_header_name<T>(self, v: Option<T>) -> Self
Sets or clears the value of http_header_name.
§Example
let x = ConsistentHashLoadBalancerSettings::new().set_or_clear_http_header_name(Some("example"));
let x = ConsistentHashLoadBalancerSettings::new().set_or_clear_http_header_name(None::<String>);Sourcepub fn set_minimum_ring_size<T>(self, v: T) -> Self
pub fn set_minimum_ring_size<T>(self, v: T) -> Self
Sets the value of minimum_ring_size.
§Example
let x = ConsistentHashLoadBalancerSettings::new().set_minimum_ring_size(42);Sourcepub fn set_or_clear_minimum_ring_size<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_minimum_ring_size<T>(self, v: Option<T>) -> Self
Sets or clears the value of minimum_ring_size.
§Example
let x = ConsistentHashLoadBalancerSettings::new().set_or_clear_minimum_ring_size(Some(42));
let x = ConsistentHashLoadBalancerSettings::new().set_or_clear_minimum_ring_size(None::<i32>);Trait Implementations§
Source§impl Clone for ConsistentHashLoadBalancerSettings
impl Clone for ConsistentHashLoadBalancerSettings
Source§fn clone(&self) -> ConsistentHashLoadBalancerSettings
fn clone(&self) -> ConsistentHashLoadBalancerSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for ConsistentHashLoadBalancerSettings
impl Default for ConsistentHashLoadBalancerSettings
Source§fn default() -> ConsistentHashLoadBalancerSettings
fn default() -> ConsistentHashLoadBalancerSettings
Source§impl PartialEq for ConsistentHashLoadBalancerSettings
impl PartialEq for ConsistentHashLoadBalancerSettings
Source§fn eq(&self, other: &ConsistentHashLoadBalancerSettings) -> bool
fn eq(&self, other: &ConsistentHashLoadBalancerSettings) -> bool
self and other values to be equal, and is used by ==.