routing::bedrock::request_metadata

Trait Metadata

Source
pub trait Metadata<T> {
    const KEY: &'static str;

    // Required methods
    fn set_metadata(&self, value: T);
    fn get_metadata(&self) -> Option<T>;
}
Expand description

A type which has accessors for route request metadata of type T.

Required Associated Constants§

Source

const KEY: &'static str

A key string used for setting and getting the metadata.

Required Methods§

Source

fn set_metadata(&self, value: T)

Infallibly assigns value to self.

Source

fn get_metadata(&self) -> Option<T>

Retrieves the subdir metadata from self, if present.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Metadata<Availability> for Dict

Source§

const KEY: &'static str = "availability"

Source§

fn set_metadata(&self, value: Availability)

Source§

fn get_metadata(&self) -> Option<Availability>

Source§

impl Metadata<Rights> for Dict

Source§

const KEY: &'static str = "rights"

Source§

fn set_metadata(&self, value: Rights)

Source§

fn get_metadata(&self) -> Option<Rights>

Implementors§