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

pub struct Upgrade(pub Vec<Protocol>);

Upgrade header, defined in RFC7230

The Upgrade header field is intended to provide a simple mechanism for transitioning from HTTP/1.1 to some other protocol on the same connection. A client MAY send a list of protocols in the Upgrade header field of a request to invite the server to switch to one or more of those protocols, in order of descending preference, before sending the final response. A server MAY ignore a received Upgrade header field if it wishes to continue using the current protocol on that connection. Upgrade cannot be used to insist on a protocol change.

ABNF

Upgrade          = 1#protocol

protocol         = protocol-name ["/" protocol-version]
protocol-name    = token
protocol-version = token

Example values

Trait Implementations

impl Deref for Upgrade

type Target = Vec<Protocol>

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

impl DerefMut for Upgrade

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

impl Header for Upgrade

fn header_name() -> &'static str

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

impl HeaderFormat for Upgrade

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

impl Display for Upgrade

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

Derived Implementations

impl PartialEq<Upgrade> for Upgrade

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

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

impl Debug for Upgrade

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

impl Clone for Upgrade

fn clone(&self) -> Upgrade

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