#[non_exhaustive]pub enum StickyPolicy {
Disabled,
Domain {
ttl: Duration,
},
}Expand description
Policy controlling when and how proxy sessions are pinned to a key.
§Example
use stygian_proxy::session::StickyPolicy;
use std::time::Duration;
let policy = StickyPolicy::domain(Duration::from_secs(600));
assert!(!policy.is_disabled());Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Disabled
No session stickiness — every request may use a different proxy.
Domain
Pin by domain with a fixed TTL per binding.
Implementations§
Source§impl StickyPolicy
impl StickyPolicy
Sourcepub fn domain_default() -> Self
pub fn domain_default() -> Self
Create a domain-scoped policy with the default TTL (5 minutes).
Sourcepub const fn is_disabled(&self) -> bool
pub const fn is_disabled(&self) -> bool
Returns true when session stickiness is turned off.
Trait Implementations§
Source§impl Clone for StickyPolicy
impl Clone for StickyPolicy
Source§fn clone(&self) -> StickyPolicy
fn clone(&self) -> StickyPolicy
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 StickyPolicy
impl Debug for StickyPolicy
Source§impl Default for StickyPolicy
impl Default for StickyPolicy
Source§fn default() -> StickyPolicy
fn default() -> StickyPolicy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for StickyPolicy
impl<'de> Deserialize<'de> for StickyPolicy
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for StickyPolicy
impl RefUnwindSafe for StickyPolicy
impl Send for StickyPolicy
impl Sync for StickyPolicy
impl Unpin for StickyPolicy
impl UnsafeUnpin for StickyPolicy
impl UnwindSafe for StickyPolicy
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