Trait cookie::prefix::Prefix

source ·
pub trait Prefix: Sealed {
    const PREFIX: &'static str;
    const Host: Host = Host;
    const Secure: Secure = Secure;

    // Required method
    fn conform(cookie: Cookie<'_>) -> Cookie<'_>;
}
Expand description

Trait identifying HTTP RFC6265 draft cookie prefixes.

A Prefix can be applied to cookies via a child PrefixedJar, itself obtainable via CookieJar::prefixed() and CookieJar::prefixed_mut(). Cookies added/retrieved to/from these child jars have the corresponding prefix automatically prepended/removed as needed. Additionally, added cookies are automatically make to conform.

Note: Cookie prefixes are specified in an HTTP draft! Their meaning and definition are subject to change.

Required Associated Constants§

source

const PREFIX: &'static str

The prefix string to prepend.

See Host::PREFIX and Secure::PREFIX for specifics.

Provided Associated Constants§

source

const Host: Host = Host

Alias to Host.

source

const Secure: Secure = Secure

Alias to Secure.

Required Methods§

source

fn conform(cookie: Cookie<'_>) -> Cookie<'_>

Modify cookie so it conforms to the requirements of self.

See Host::conform() and Secure::conform() for specifics.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Prefix for Host

source§

const PREFIX: &'static str = "__Host-"

source§

impl Prefix for Secure

source§

const PREFIX: &'static str = "__Secure-"