Struct http_types::headers::HeaderName [−][src]
pub struct HeaderName(_);
A header name.
Implementations
impl HeaderName
[src]
impl HeaderName
[src]pub fn from_bytes(bytes: Vec<u8>) -> Result<Self, Error>
[src]
Create a new HeaderName
from a Vec of ASCII bytes.
Error
This function will error if the bytes is not valid ASCII.
pub fn from_string(s: String) -> Result<Self, Error>
[src]
Create a new HeaderName
from an ASCII string.
Error
This function will error if the string is not valid ASCII.
pub fn as_str(&self) -> &str
[src]
Returns the header name as a &str
.
pub unsafe fn from_bytes_unchecked(bytes: Vec<u8>) -> Self
[src]
Converts a vector of bytes to a HeaderName
without checking that the string contains
valid ASCII.
Safety
This function is unsafe because it does not check that the bytes passed to it are valid ASCII. If this constraint is violated, it may cause memory unsafety issues with future users of the HeaderName, as the rest of the library assumes that Strings are valid ASCII.
Trait Implementations
impl Clone for HeaderName
[src]
impl Clone for HeaderName
[src]fn clone(&self) -> HeaderName
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Eq for HeaderName
[src]
impl Eq for HeaderName
[src]impl From<&'_ HeaderName> for HeaderName
[src]
impl From<&'_ HeaderName> for HeaderName
[src]fn from(value: &HeaderName) -> HeaderName
[src]
impl FromStr for HeaderName
[src]
impl FromStr for HeaderName
[src]impl Hash for HeaderName
[src]
impl Hash for HeaderName
[src]impl Index<HeaderName> for Headers
[src]
impl Index<HeaderName> for Headers
[src]type Output = HeaderValues
The returned type after indexing.
fn index(&self, name: HeaderName) -> &HeaderValues
[src]
Returns a reference to the value corresponding to the supplied name.
Panics
Panics if the name is not present in Headers
.
impl Index<HeaderName> for Request
[src]
impl Index<HeaderName> for Request
[src]type Output = HeaderValues
The returned type after indexing.
fn index(&self, name: HeaderName) -> &HeaderValues
[src]
Returns a reference to the value corresponding to the supplied name.
Panics
Panics if the name is not present in Request
.
impl Index<HeaderName> for Response
[src]
impl Index<HeaderName> for Response
[src]type Output = HeaderValues
The returned type after indexing.
fn index(&self, name: HeaderName) -> &HeaderValues
[src]
Returns a reference to the value corresponding to the supplied name.
Panics
Panics if the name is not present in Response
.
impl Index<HeaderName> for Trailers
[src]
impl Index<HeaderName> for Trailers
[src]type Output = HeaderValues
The returned type after indexing.
fn index(&self, name: HeaderName) -> &HeaderValues
[src]
Returns a reference to the value corresponding to the supplied name.
Panics
Panics if the name is not present in Trailers
.
impl<'a> PartialEq<&'_ String> for HeaderName
[src]
impl<'a> PartialEq<&'_ String> for HeaderName
[src]impl<'a> PartialEq<&'a str> for HeaderName
[src]
impl<'a> PartialEq<&'a str> for HeaderName
[src]impl PartialEq<HeaderName> for HeaderName
[src]
impl PartialEq<HeaderName> for HeaderName
[src]fn eq(&self, other: &HeaderName) -> bool
[src]
fn ne(&self, other: &HeaderName) -> bool
[src]
impl PartialEq<String> for HeaderName
[src]
impl PartialEq<String> for HeaderName
[src]impl PartialEq<str> for HeaderName
[src]
impl PartialEq<str> for HeaderName
[src]impl StructuralEq for HeaderName
[src]
impl StructuralEq for HeaderName
[src]impl StructuralPartialEq for HeaderName
[src]
impl StructuralPartialEq for HeaderName
[src]Auto Trait Implementations
impl RefUnwindSafe for HeaderName
impl RefUnwindSafe for HeaderName
impl Send for HeaderName
impl Send for HeaderName
impl Sync for HeaderName
impl Sync for HeaderName
impl Unpin for HeaderName
impl Unpin for HeaderName
impl UnwindSafe for HeaderName
impl UnwindSafe for HeaderName
Blanket Implementations
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,