[][src]Struct hyper::header::Link

pub struct Link { /* fields omitted */ }

The Link header, defined in RFC5988

ABNF

Link           = "Link" ":" #link-value
link-value     = "<" URI-Reference ">" *( ";" link-param )
link-param     = ( ( "rel" "=" relation-types )
               | ( "anchor" "=" <"> URI-Reference <"> )
               | ( "rev" "=" relation-types )
               | ( "hreflang" "=" Language-Tag )
               | ( "media" "=" ( MediaDesc | ( <"> MediaDesc <"> ) ) )
               | ( "title" "=" quoted-string )
               | ( "title*" "=" ext-value )
               | ( "type" "=" ( media-type | quoted-mt ) )
               | ( link-extension ) )
link-extension = ( parmname [ "=" ( ptoken | quoted-string ) ] )
               | ( ext-name-star "=" ext-value )
ext-name-star  = parmname "*" ; reserved for RFC2231-profiled
; extensions.  Whitespace NOT
; allowed in between.
ptoken         = 1*ptokenchar
ptokenchar     = "!" | "#" | "$" | "%" | "&" | "'" | "("
               | ")" | "*" | "+" | "-" | "." | "/" | DIGIT
               | ":" | "<" | "=" | ">" | "?" | "@" | ALPHA
               | "[" | "]" | "^" | "_" | "`" | "{" | "|"
               | "}" | "~"
media-type     = type-name "/" subtype-name
quoted-mt      = <"> media-type <">
relation-types = relation-type
               | <"> relation-type *( 1*SP relation-type ) <">
relation-type  = reg-rel-type | ext-rel-type
reg-rel-type   = LOALPHA *( LOALPHA | DIGIT | "." | "-" )
ext-rel-type   = URI

Example values

Link: <http://example.com/TheBook/chapter2>; rel="previous"; title="previous chapter"

Link: </TheBook/chapter2>; rel="previous"; title*=UTF-8'de'letztes%20Kapitel, </TheBook/chapter4>; rel="next"; title*=UTF-8'de'n%c3%a4chstes%20Kapitel

Examples

use hyper::header::{Headers, Link, LinkValue, RelationType};

let link_value = LinkValue::new("http://example.com/TheBook/chapter2")
    .push_rel(RelationType::Previous)
    .set_title("previous chapter");

let mut headers = Headers::new();
headers.set(
    Link::new(vec![link_value])
);

Methods

impl Link
[src]

Create Link from a Vec<LinkValue>.

Get the Link header's LinkValues.

Add a LinkValue instance to the Link header's values.

Trait Implementations

impl Header for Link
[src]

Returns the name of the header field this belongs to. Read more

Parse a header from a raw stream of bytes. Read more

impl HeaderFormat for Link
[src]

Format a header to be output into a TcpStream. Read more

impl PartialEq<Link> for Link
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Clone for Link
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Link
[src]

Formats the value using the given formatter. Read more

impl Display for Link
[src]

Formats the value using the given formatter. Read more

impl FromStr for Link
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Auto Trait Implementations

impl Send for Link

impl Sync for Link

Blanket Implementations

impl<T> HeaderClone for T where
    T: Sealed, 
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

Converts the given value to a String. Read more

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Typeable for T where
    T: Any
[src]

Get the TypeId of this object.