(status: StatusCode, body: Vec<u8>, kind: &str)
| 110 | } |
| 111 | } |
| 112 | fn reply(status: StatusCode, body: Vec<u8>, kind: &str) -> Response { |
| 113 | ( |
| 114 | status, |
| 115 | [(PROTOCOL_HEADER, PROTOCOL_SYNC_V1), ("content-type", kind)], |
| 116 | body, |
| 117 | ) |
| 118 | .into_response() |
| 119 | } |
| 120 | fn supported(headers: &HeaderMap) -> bool { |
| 121 | headers.get(PROTOCOL_HEADER).and_then(|h| h.to_str().ok()) == Some(PROTOCOL_SYNC_V1) |
| 122 | } |