Struct iron::headers::Connection [-] [+] [src]

pub struct Connection(pub Vec<ConnectionOption>);

Connection header, defined in RFC7230

The Connection header field allows the sender to indicate desired control options for the current connection. In order to avoid confusing downstream recipients, a proxy or gateway MUST remove or replace any received connection options before forwarding the message.

ABNF

Connection        = 1#connection-option
connection-option = token

# Example values
* `close`
* `keep-alive`
* `upgrade`

Methods

impl Connection

fn close() -> Connection

A constructor to easily create a Connection: close header.

fn keep_alive() -> Connection

A constructor to easily create a Connection: keep-alive header.

Trait Implementations

impl Deref for Connection

type Target = Vec<ConnectionOption>

fn deref(&'a self) -> &'a Vec<ConnectionOption>

impl DerefMut for Connection

fn deref_mut(&'a mut self) -> &'a mut Vec<ConnectionOption>

impl Header for Connection

fn header_name() -> &'static str

fn parse_header(raw: &[Vec<u8>]) -> Option<Connection>

impl HeaderFormat for Connection

fn fmt_header(&self, f: &mut Formatter) -> Result<(), Error>

impl Display for Connection

fn fmt(&self, f: &mut Formatter) -> Result<(), Error>

Derived Implementations

impl PartialEq<Connection> for Connection

fn eq(&self, __arg_0: &Connection) -> bool

fn ne(&self, __arg_0: &Connection) -> bool

impl Debug for Connection

fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>

impl Clone for Connection

fn clone(&self) -> Connection

fn clone_from(&mut self, source: &Self)