Trait websocket::header::Header [−][src]
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
pub fn header_name() -> &'static str[src]
Returns the name of the header field this belongs to.
This will become an associated constant once available.
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Self, Error>[src]
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]
pub fn header_name() -> &'static str[src]
pub fn parse_header(
raw: &[Vec<u8, Global>]
) -> Result<AccessControlAllowOrigin, Error>[src]
raw: &[Vec<u8, Global>]
) -> Result<AccessControlAllowOrigin, Error>
impl Header for Expect[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Expect, Error>[src]
impl Header for IfMatch[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<IfMatch, Error>[src]
impl Header for IfNoneMatch[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<IfNoneMatch, Error>[src]
impl Header for IfRange[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<IfRange, Error>[src]
impl Header for Pragma[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Pragma, Error>[src]
impl Header for Range[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Range, Error>[src]
impl Header for ReferrerPolicy[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<ReferrerPolicy, Error>[src]
impl Header for Vary[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Vary, Error>[src]
impl Header for WebSocketVersion[src]
fn header_name() -> &'static str[src]
fn parse_header(raw: &[Vec<u8>]) -> Result<WebSocketVersion>[src]
impl Header for WebSocketExtensions[src]
fn header_name() -> &'static str[src]
fn parse_header(raw: &[Vec<u8>]) -> Result<WebSocketExtensions>[src]
impl Header for Accept[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Accept, Error>[src]
impl Header for AcceptCharset[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<AcceptCharset, Error>[src]
impl Header for AcceptEncoding[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<AcceptEncoding, Error>[src]
impl Header for AcceptLanguage[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<AcceptLanguage, Error>[src]
impl Header for AcceptRanges[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<AcceptRanges, Error>[src]
impl Header for AccessControlAllowCredentials[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(
raw: &[Vec<u8, Global>]
) -> Result<AccessControlAllowCredentials, Error>[src]
raw: &[Vec<u8, Global>]
) -> Result<AccessControlAllowCredentials, Error>
impl Header for AccessControlAllowHeaders[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(
raw: &[Vec<u8, Global>]
) -> Result<AccessControlAllowHeaders, Error>[src]
raw: &[Vec<u8, Global>]
) -> Result<AccessControlAllowHeaders, Error>
impl Header for AccessControlAllowMethods[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(
raw: &[Vec<u8, Global>]
) -> Result<AccessControlAllowMethods, Error>[src]
raw: &[Vec<u8, Global>]
) -> Result<AccessControlAllowMethods, Error>
impl Header for AccessControlExposeHeaders[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(
raw: &[Vec<u8, Global>]
) -> Result<AccessControlExposeHeaders, Error>[src]
raw: &[Vec<u8, Global>]
) -> Result<AccessControlExposeHeaders, Error>
impl Header for AccessControlMaxAge[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(
raw: &[Vec<u8, Global>]
) -> Result<AccessControlMaxAge, Error>[src]
raw: &[Vec<u8, Global>]
) -> Result<AccessControlMaxAge, Error>
impl Header for AccessControlRequestHeaders[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(
raw: &[Vec<u8, Global>]
) -> Result<AccessControlRequestHeaders, Error>[src]
raw: &[Vec<u8, Global>]
) -> Result<AccessControlRequestHeaders, Error>
impl Header for AccessControlRequestMethod[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(
raw: &[Vec<u8, Global>]
) -> Result<AccessControlRequestMethod, Error>[src]
raw: &[Vec<u8, Global>]
) -> Result<AccessControlRequestMethod, Error>
impl Header for Allow[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Allow, Error>[src]
impl Header for CacheControl[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<CacheControl, Error>[src]
impl Header for Connection[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Connection, Error>[src]
impl Header for ContentDisposition[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(
raw: &[Vec<u8, Global>]
) -> Result<ContentDisposition, Error>[src]
raw: &[Vec<u8, Global>]
) -> Result<ContentDisposition, Error>
impl Header for ContentEncoding[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<ContentEncoding, Error>[src]
impl Header for ContentLanguage[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<ContentLanguage, Error>[src]
impl Header for ContentLength[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<ContentLength, Error>[src]
impl Header for ContentRange[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<ContentRange, Error>[src]
impl Header for ContentType[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<ContentType, Error>[src]
impl Header for Cookie[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Cookie, Error>[src]
impl Header for Date[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Date, Error>[src]
impl Header for ETag[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<ETag, Error>[src]
impl Header for Expires[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Expires, Error>[src]
impl Header for From[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<From, Error>[src]
impl Header for Host[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Host, Error>[src]
impl Header for IfModifiedSince[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<IfModifiedSince, Error>[src]
impl Header for IfUnmodifiedSince[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<IfUnmodifiedSince, Error>[src]
impl Header for LastModified[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<LastModified, Error>[src]
impl Header for Link[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Link, Error>[src]
impl Header for Location[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Location, Error>[src]
impl Header for websocket::header::Origin[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Origin, Error>[src]
impl Header for websocket::header::Origin[src]
impl Header for Prefer[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Prefer, Error>[src]
impl Header for PreferenceApplied[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<PreferenceApplied, Error>[src]
impl Header for Referer[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Referer, Error>[src]
impl Header for Server[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Server, Error>[src]
impl Header for SetCookie[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<SetCookie, Error>[src]
impl Header for StrictTransportSecurity[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(
raw: &[Vec<u8, Global>]
) -> Result<StrictTransportSecurity, Error>[src]
raw: &[Vec<u8, Global>]
) -> Result<StrictTransportSecurity, Error>
impl Header for TransferEncoding[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<TransferEncoding, Error>[src]
impl Header for Upgrade[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<Upgrade, Error>[src]
impl Header for UserAgent[src]
pub fn header_name() -> &'static str[src]
pub fn parse_header(raw: &[Vec<u8, Global>]) -> Result<UserAgent, Error>[src]
impl Header for WebSocketAccept[src]
fn header_name() -> &'static str[src]
fn parse_header(raw: &[Vec<u8>]) -> Result<WebSocketAccept>[src]
impl Header for WebSocketKey[src]
fn header_name() -> &'static str[src]
fn parse_header(raw: &[Vec<u8>]) -> Result<WebSocketKey>[src]
impl Header for WebSocketProtocol[src]
fn header_name() -> &'static str[src]
fn parse_header(raw: &[Vec<u8>]) -> Result<WebSocketProtocol>[src]
impl<S> Header for Authorization<S> where
S: Scheme + Any,
<S as FromStr>::Err: 'static, [src]
S: Scheme + Any,
<S as FromStr>::Err: 'static,