[−][src]Trait http::HttpTryFrom
Private trait for the http
crate to have generic methods with fallible
conversions.
This trait is similar to the TryFrom
trait proposed in the standard
library, except this is specialized for the http
crate and isn't intended
for general consumption.
This trait cannot be implemented types outside of the http
crate, and is
only intended for use as a generic bound on methods in the http
crate.
Associated Types
Loading content...Implementors
impl HttpTryFrom<i16> for HeaderValue
[src]
impl HttpTryFrom<i32> for HeaderValue
[src]
impl HttpTryFrom<i64> for HeaderValue
[src]
impl HttpTryFrom<isize> for HeaderValue
[src]
impl HttpTryFrom<u16> for HeaderValue
[src]
impl HttpTryFrom<u16> for StatusCode
[src]
impl HttpTryFrom<u32> for HeaderValue
[src]
impl HttpTryFrom<u64> for HeaderValue
[src]
impl HttpTryFrom<usize> for HeaderValue
[src]
impl HttpTryFrom<Bytes> for HeaderName
[src]
impl HttpTryFrom<Bytes> for HeaderValue
[src]
impl HttpTryFrom<Bytes> for Authority
[src]
impl HttpTryFrom<Bytes> for PathAndQuery
[src]
impl HttpTryFrom<Bytes> for Scheme
[src]
impl HttpTryFrom<Bytes> for Uri
[src]
impl HttpTryFrom<HeaderName> for HeaderName
[src]
impl HttpTryFrom<HeaderName> for HeaderValue
[src]
type Error = InvalidHeaderValue
fn try_from(name: HeaderName) -> Result<Self, Self::Error>
[src]
impl HttpTryFrom<HeaderValue> for HeaderValue
[src]
impl HttpTryFrom<Method> for Method
[src]
impl HttpTryFrom<StatusCode> for StatusCode
[src]
impl HttpTryFrom<Authority> for Authority
[src]
impl HttpTryFrom<Parts> for Uri
[src]
impl HttpTryFrom<PathAndQuery> for PathAndQuery
[src]
impl HttpTryFrom<Scheme> for Scheme
[src]
impl HttpTryFrom<Uri> for Uri
[src]
impl HttpTryFrom<String> for HeaderValue
[src]
impl HttpTryFrom<String> for Uri
[src]
impl<'a> HttpTryFrom<&'a str> for HeaderName
[src]
impl<'a> HttpTryFrom<&'a str> for HeaderValue
[src]
impl<'a> HttpTryFrom<&'a str> for Method
[src]
impl<'a> HttpTryFrom<&'a str> for StatusCode
[src]
impl<'a> HttpTryFrom<&'a str> for Authority
[src]
impl<'a> HttpTryFrom<&'a str> for PathAndQuery
[src]
impl<'a> HttpTryFrom<&'a str> for Scheme
[src]
impl<'a> HttpTryFrom<&'a str> for Uri
[src]
impl<'a> HttpTryFrom<&'a HeaderName> for HeaderName
[src]
impl<'a> HttpTryFrom<&'a HeaderValue> for HeaderValue
[src]
impl<'a> HttpTryFrom<&'a Method> for Method
[src]
impl<'a> HttpTryFrom<&'a StatusCode> for StatusCode
[src]
impl<'a> HttpTryFrom<&'a Uri> for Uri
[src]
impl<'a> HttpTryFrom<&'a String> for HeaderName
[src]
impl<'a> HttpTryFrom<&'a String> for HeaderValue
[src]
impl<'a> HttpTryFrom<&'a String> for Uri
[src]
impl<'a> HttpTryFrom<&'a [u8]> for HeaderName
[src]
impl<'a> HttpTryFrom<&'a [u8]> for HeaderValue
[src]
impl<'a> HttpTryFrom<&'a [u8]> for Method
[src]
impl<'a> HttpTryFrom<&'a [u8]> for StatusCode
[src]
impl<'a> HttpTryFrom<&'a [u8]> for Authority
[src]
impl<'a> HttpTryFrom<&'a [u8]> for PathAndQuery
[src]
impl<'a> HttpTryFrom<&'a [u8]> for Scheme
[src]
impl<'a, K, V, T> HttpTryFrom<&'a HashMap<K, V, RandomState>> for HeaderMap<T> where
K: Eq + Hash,
HeaderName: HttpTryFrom<&'a K>,
T: HttpTryFrom<&'a V>,
[src]
K: Eq + Hash,
HeaderName: HttpTryFrom<&'a K>,
T: HttpTryFrom<&'a V>,
Try to convert a HashMap
into a HeaderMap
.
Examples
use std::collections::HashMap; use http::{HttpTryFrom, header::HeaderMap}; let mut map = HashMap::new(); map.insert("X-Custom-Header".to_string(), "my value".to_string()); let headers: HeaderMap = HttpTryFrom::try_from(&map).expect("valid headers"); assert_eq!(headers["X-Custom-Header"], "my value");