Skip to main content

Prefix

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Prefix for Host

Source§

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

Source§

impl Prefix for Secure

Source§

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