pub struct Allow { /* private fields */ }
Expand description
List the set of methods supported by a resource.
§Specifications
§Examples
use http_types_rs::{Method, Response};
use http_types_rs::server::Allow;
let mut allow = Allow::new();
allow.insert(Method::Put);
allow.insert(Method::Post);
let mut res = Response::new(200);
res.insert_header(&allow, &allow);
let allow = Allow::from_headers(res)?.unwrap();
assert!(allow.contains(Method::Put));
assert!(allow.contains(Method::Post));
Implementations§
Trait Implementations§
Source§impl Header for Allow
impl Header for Allow
Source§fn header_name(&self) -> HeaderName
fn header_name(&self) -> HeaderName
Access the header’s name.
Source§fn header_value(&self) -> HeaderValue
fn header_value(&self) -> HeaderValue
Access the header’s value.
Source§impl<'a> IntoIterator for &'a Allow
impl<'a> IntoIterator for &'a Allow
Auto Trait Implementations§
impl Freeze for Allow
impl RefUnwindSafe for Allow
impl Send for Allow
impl Sync for Allow
impl Unpin for Allow
impl UnwindSafe for Allow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> ToHeaderValues for Twhere
T: Header,
impl<T> ToHeaderValues for Twhere
T: Header,
Source§type Iter = IntoIter<HeaderValue>
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
Source§fn to_header_values(&self) -> Result<<T as ToHeaderValues>::Iter, Error>
fn to_header_values(&self) -> Result<<T as ToHeaderValues>::Iter, Error>
Converts this object to an iterator of resolved
HeaderValues
.