Skip to main content

MetaMap

Trait MetaMap 

Source
pub trait MetaMap {
    // Required methods
    fn get_meta(&self, key: MetaKey) -> Option<&str>;
    fn meta_values<'a>(
        &'a self,
        key: MetaKey,
    ) -> Box<dyn Iterator<Item = &'a str> + 'a>;
    fn sorted_meta_keys(&self) -> Vec<MetaKey>;
    fn ctx_fields(&self) -> Vec<(&str, &[u8])>;
}

Required Methods§

Source

fn get_meta(&self, key: MetaKey) -> Option<&str>

Source

fn meta_values<'a>( &'a self, key: MetaKey, ) -> Box<dyn Iterator<Item = &'a str> + 'a>

Source

fn sorted_meta_keys(&self) -> Vec<MetaKey>

Returns all meta keys, sorted alphabetically based on MetaKey::header_key.

Source

fn ctx_fields(&self) -> Vec<(&str, &[u8])>

Every value of every Request Context header (crate::reqctx::HEADER_PREFIX), with its header’s name, in no particular order. Values are bytes, so one that is not UTF-8 is still covered by a call’s signature.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl MetaMap for HeaderMap

Source§

fn get_meta(&self, key: MetaKey) -> Option<&str>

Source§

fn meta_values<'a>( &'a self, key: MetaKey, ) -> Box<dyn Iterator<Item = &'a str> + 'a>

Source§

fn sorted_meta_keys(&self) -> Vec<MetaKey>

Source§

fn ctx_fields(&self) -> Vec<(&str, &[u8])>

Implementors§