1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use std::fmt::{self};
use header;
use method;
#[derive(Clone, PartialEq, Debug)]
pub struct AccessControlAllowMethods(pub Vec<method::Method>);
impl header::Header for AccessControlAllowMethods {
#[inline]
fn header_name() -> &'static str {
"Access-Control-Allow-Methods"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<AccessControlAllowMethods> {
header::parsing::from_comma_delimited(raw).map(AccessControlAllowMethods)
}
}
impl header::HeaderFormat for AccessControlAllowMethods {
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
let AccessControlAllowMethods(ref parts) = *self;
header::parsing::fmt_comma_delimited(f, parts.as_slice())
}
}