[][src]Trait websocket::header::Header

pub trait Header: Send + Sync + Clone + Any {
    fn header_name() -> &'static str;
fn parse_header(raw: &[Vec<u8>]) -> Result<Self, Error>; }

A trait for any object that will represent a header field and value.

This trait represents the construction and identification of headers, and contains trait-object unsafe methods.

Required Methods

Returns the name of the header field this belongs to.

This will become an associated constant once available.

Parse a header from a raw stream of bytes.

It's possible that a request can include a header field more than once, and in that case, the slice will have a length greater than 1. However, it's not necessarily the case that a Header is allowed to have more than one field value. If that's the case, you should return None if raw.len() > 1.

Implementors

impl Header for AccessControlAllowOrigin
[src]

impl Header for Expect
[src]

impl Header for IfMatch
[src]

impl Header for IfNoneMatch
[src]

impl Header for IfRange
[src]

impl Header for Pragma
[src]

impl Header for Range
[src]

impl Header for ReferrerPolicy
[src]

impl Header for Vary
[src]

impl Header for WebSocketVersion
[src]

impl Header for WebSocketExtensions
[src]

impl Header for Accept
[src]

impl Header for AcceptCharset
[src]

impl Header for AcceptEncoding
[src]

impl Header for AcceptLanguage
[src]

impl Header for AcceptRanges
[src]

impl Header for AccessControlAllowCredentials
[src]

impl Header for AccessControlAllowHeaders
[src]

impl Header for AccessControlAllowMethods
[src]

impl Header for AccessControlExposeHeaders
[src]

impl Header for AccessControlMaxAge
[src]

impl Header for AccessControlRequestHeaders
[src]

impl Header for AccessControlRequestMethod
[src]

impl Header for Allow
[src]

impl Header for CacheControl
[src]

impl Header for Connection
[src]

impl Header for ContentDisposition
[src]

impl Header for ContentEncoding
[src]

impl Header for ContentLanguage
[src]

impl Header for ContentLength
[src]

impl Header for ContentRange
[src]

impl Header for ContentType
[src]

impl Header for Cookie
[src]

impl Header for Date
[src]

impl Header for ETag
[src]

impl Header for Expires
[src]

impl Header for From
[src]

impl Header for Host
[src]

impl Header for IfModifiedSince
[src]

impl Header for IfUnmodifiedSince
[src]

impl Header for LastModified
[src]

impl Header for Link
[src]

impl Header for Location
[src]

impl Header for websocket::header::Origin
[src]

impl Header for websocket::header::Origin
[src]

impl Header for Prefer
[src]

impl Header for PreferenceApplied
[src]

impl Header for Referer
[src]

impl Header for Server
[src]

impl Header for SetCookie
[src]

impl Header for StrictTransportSecurity
[src]

impl Header for TransferEncoding
[src]

impl Header for Upgrade
[src]

impl Header for UserAgent
[src]

impl Header for WebSocketAccept
[src]

impl Header for WebSocketKey
[src]

impl Header for WebSocketProtocol
[src]

impl<S> Header for Authorization<S> where
    S: Scheme + Any,
    <S as FromStr>::Err: 'static, 
[src]