Struct hyperx::header::Link [−][src]
pub struct Link { /* fields omitted */ }
Expand description
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 hyperx::header::{Link, LinkValue, RelationType, TypedHeaders};
let link_value = LinkValue::new("http://example.com/TheBook/chapter2")
.push_rel(RelationType::Previous)
.set_title("previous chapter");
let mut headers = http::HeaderMap::new();
headers.encode(
&Link::new(vec![link_value])
);
Implementations
Trait Implementations
The HeaderName
from the http crate for this header.
Auto Trait Implementations
impl RefUnwindSafe for Link
impl UnwindSafe for Link
Blanket Implementations
Mutably borrows from an owned value. Read more