File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ header ! {
2
+ /// `Last-Event-ID` header, defined in
3
+ /// [RFC3864](https://html.spec.whatwg.org/multipage/references.html#refsRFC3864)
4
+ ///
5
+ /// The `Last-Event-ID` header contains information about
6
+ /// the last event in an http interaction so that it's easier to
7
+ /// track of event state. This is helpful when working
8
+ /// with [Server-Sent-Events](http://www.html5rocks.com/en/tutorials/eventsource/basics/). If the connection were to be dropped, for example, it'd
9
+ /// be useful to let the server know what the last event you
10
+ /// recieved was.
11
+ ///
12
+ /// The spec is a String with the id of the last event, it can be
13
+ /// an empty string which acts a sort of "reset".
14
+ ///
15
+ /// # Example
16
+ /// ```
17
+ /// use hyper::header::{Headers, LastEventID};
18
+ ///
19
+ /// let mut headers = Headers::new();
20
+ /// headers.set(LastEventID("1".to_owned()));
21
+ /// ```
22
+ ( LastEventID , "Last-Event-ID" ) => [ String ]
23
+
24
+ test_last_event_id {
25
+ // Initial state
26
+ test_header!( test1, vec![ b"" ] ) ;
27
+ // Own testcase
28
+ test_header!( test2, vec![ b"1" ] , Some ( LastEventID ( "1" . to_owned( ) ) ) ) ;
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments