#[non_exhaustive]pub enum SessionAffinity {
ClientIp,
ClientIpNoDestination,
ClientIpPortProto,
ClientIpProto,
GeneratedCookie,
HeaderField,
HttpCookie,
None,
StrongCookieAffinity,
UnknownValue(UnknownValue),
}target-pools only.Expand description
The enumerated type for the sessionAffinity field.
§Working with unknown values
This enum is defined as #[non_exhaustive] because Google Cloud may add
additional enum variants at any time. Adding new variants is not considered
a breaking change. Applications should write their code in anticipation of:
- New values appearing in future releases of the client library, and
- New values received dynamically, without application changes.
Please consult the Working with enums section in the user guide for some guidelines.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ClientIp
2-tuple hash on packet’s source and destination IP addresses. Connections from the same source IP address to the same destination IP address will be served by the same backend VM while that VM remains healthy.
ClientIpNoDestination
1-tuple hash only on packet’s source IP address. Connections from the same source IP address will be served by the same backend VM while that VM remains healthy. This option can only be used for Internal TCP/UDP Load Balancing.
ClientIpPortProto
5-tuple hash on packet’s source and destination IP addresses, IP protocol, and source and destination ports. Connections for the same IP protocol from the same source IP address and port to the same destination IP address and port will be served by the same backend VM while that VM remains healthy. This option cannot be used for HTTP(S) load balancing.
ClientIpProto
3-tuple hash on packet’s source and destination IP addresses, and IP protocol. Connections for the same IP protocol from the same source IP address to the same destination IP address will be served by the same backend VM while that VM remains healthy. This option cannot be used for HTTP(S) load balancing.
GeneratedCookie
Hash based on a cookie generated by the L7 loadbalancer. Only valid for HTTP(S) load balancing.
HeaderField
The hash is based on a user specified header field.
HttpCookie
The hash is based on a user provided cookie.
None
No session affinity. Connections from the same client IP may go to any instance in the pool.
StrongCookieAffinity
Strong cookie-based affinity. Connections bearing the same cookie will be served by the same backend VM while that VM remains healthy, as long as the cookie has not expired.
UnknownValue(UnknownValue)
If set, the enum was initialized with an unknown value.
Applications can examine the value using SessionAffinity::value or SessionAffinity::name.
Implementations§
Trait Implementations§
Source§impl Clone for SessionAffinity
impl Clone for SessionAffinity
Source§fn clone(&self) -> SessionAffinity
fn clone(&self) -> SessionAffinity
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SessionAffinity
impl Debug for SessionAffinity
Source§impl Default for SessionAffinity
impl Default for SessionAffinity
Source§impl<'de> Deserialize<'de> for SessionAffinity
impl<'de> Deserialize<'de> for SessionAffinity
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>,
Source§impl Display for SessionAffinity
impl Display for SessionAffinity
Source§impl From<&str> for SessionAffinity
impl From<&str> for SessionAffinity
Source§impl From<i32> for SessionAffinity
impl From<i32> for SessionAffinity
Source§impl PartialEq for SessionAffinity
impl PartialEq for SessionAffinity
Source§impl Serialize for SessionAffinity
impl Serialize for SessionAffinity
impl StructuralPartialEq for SessionAffinity
Auto Trait Implementations§
impl Freeze for SessionAffinity
impl RefUnwindSafe for SessionAffinity
impl Send for SessionAffinity
impl Sync for SessionAffinity
impl Unpin for SessionAffinity
impl UnwindSafe for SessionAffinity
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.