Trait Extractor

pub trait Extractor {
    // Required methods
    fn get(&self, key: &str) -> Option<&str>;
    fn keys(&self) -> Vec<&str>;
}
Expand description

Extractor provides an interface for removing fields from an underlying struct like HashMap

Required Methods§

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

Get a value from a key from the underlying data.

fn keys(&self) -> Vec<&str>

Collect all the keys from the underlying data.

Implementations on Foreign Types§

§

impl Extractor for HeaderExtractor<'_>

§

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

Get a value for a key from the HeaderMap. If the value is not valid ASCII, returns None.

§

fn keys(&self) -> Vec<&str>

Collect all the keys from the HeaderMap.

Implementors§

§

impl<S> Extractor for HashMap<String, String, S>
where S: BuildHasher,