HeadersHandler

Trait HeadersHandler 

Source
pub trait HeadersHandler {
    // Required methods
    fn headers(&self) -> Vec<(String, String)>;
    fn header(&self, name: &str) -> Option<String>;
    fn add_header(&self, name: &str, value: &str);
    fn set_header(&self, name: &str, value: &str);
    fn set_headers(&self, headers: Vec<(&str, &str)>);
    fn remove_header(&self, name: &str);
}
Expand description

A handler for accessing the headers of the current HTTP Flow.

Required Methods§

Source

fn headers(&self) -> Vec<(String, String)>

Returns a list of headers represented by pairs of name and value.

Source

fn header(&self, name: &str) -> Option<String>

Returns a header by name if it exists.

Source

fn add_header(&self, name: &str, value: &str)

Adds a header value by name. If there is a header with the same name, this method will keep that and adding another header entry with the same name and the new value.

Source

fn set_header(&self, name: &str, value: &str)

Sets a header value by name. If there is a header with the same name, this method will replace the header value.

Source

fn set_headers(&self, headers: Vec<(&str, &str)>)

Sets a list of headers represented by pairs of name and value.

Source

fn remove_header(&self, name: &str)

Removes a header by name if it exists.

Implementors§