Struct ajars_surf::surf::http::headers::HeaderName
[−]pub struct HeaderName(_);
Expand description
A header name.
Implementations
impl HeaderName
impl HeaderName
pub fn from_bytes(bytes: Vec<u8, Global>) -> Result<HeaderName, Error>
pub fn from_bytes(bytes: Vec<u8, Global>) -> Result<HeaderName, Error>
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<HeaderName, Error>
pub fn from_string(s: String) -> Result<HeaderName, Error>
Create a new HeaderName
from an ASCII string.
Error
This function will error if the string is not valid ASCII.
pub unsafe fn from_bytes_unchecked(bytes: Vec<u8, Global>) -> HeaderName
pub unsafe fn from_bytes_unchecked(bytes: Vec<u8, Global>) -> HeaderName
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
impl Clone for HeaderName
fn clone(&self) -> HeaderName
fn clone(&self) -> HeaderName
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for HeaderName
impl Debug for HeaderName
impl Display for HeaderName
impl Display for HeaderName
impl<'_> From<&'_ HeaderName> for HeaderName
impl<'_> From<&'_ HeaderName> for HeaderName
fn from(value: &HeaderName) -> HeaderName
fn from(value: &HeaderName) -> HeaderName
Converts to this type from the input type.
impl<'a> From<&'a str> for HeaderName
impl<'a> From<&'a str> for HeaderName
fn from(value: &'a str) -> HeaderName
fn from(value: &'a str) -> HeaderName
Converts to this type from the input type.
impl FromStr for HeaderName
impl FromStr for HeaderName
fn from_str(s: &str) -> Result<HeaderName, <HeaderName as FromStr>::Err>
fn from_str(s: &str) -> Result<HeaderName, <HeaderName as FromStr>::Err>
Create a new HeaderName
.
This checks it’s valid ASCII, and lowercases it.
impl Hash for HeaderName
impl Hash for HeaderName
sourceimpl Index<HeaderName> for Request
impl Index<HeaderName> for Request
sourcefn index(&self, name: HeaderName) -> &HeaderValues
fn index(&self, name: HeaderName) -> &HeaderValues
Returns a reference to the value corresponding to the supplied name.
Panics
Panics if the name is not present in Request
.
type Output = HeaderValues
type Output = HeaderValues
The returned type after indexing.
sourceimpl Index<HeaderName> for Response
impl Index<HeaderName> for Response
sourcefn index(&self, name: HeaderName) -> &HeaderValues
fn index(&self, name: HeaderName) -> &HeaderValues
Returns a reference to the value corresponding to the supplied name.
Panics
Panics if the name is not present in Response
.
type Output = HeaderValues
type Output = HeaderValues
The returned type after indexing.
impl Index<HeaderName> for Response
impl Index<HeaderName> for Response
fn index(&self, name: HeaderName) -> &HeaderValues
fn index(&self, name: HeaderName) -> &HeaderValues
Returns a reference to the value corresponding to the supplied name.
Panics
Panics if the name is not present in Response
.
type Output = HeaderValues
type Output = HeaderValues
The returned type after indexing.
impl Index<HeaderName> for Request
impl Index<HeaderName> for Request
fn index(&self, name: HeaderName) -> &HeaderValues
fn index(&self, name: HeaderName) -> &HeaderValues
Returns a reference to the value corresponding to the supplied name.
Panics
Panics if the name is not present in Request
.
type Output = HeaderValues
type Output = HeaderValues
The returned type after indexing.
impl Index<HeaderName> for Trailers
impl Index<HeaderName> for Trailers
fn index(&self, name: HeaderName) -> &HeaderValues
fn index(&self, name: HeaderName) -> &HeaderValues
Returns a reference to the value corresponding to the supplied name.
Panics
Panics if the name is not present in Trailers
.
type Output = HeaderValues
type Output = HeaderValues
The returned type after indexing.
impl Index<HeaderName> for Headers
impl Index<HeaderName> for Headers
fn index(&self, name: HeaderName) -> &HeaderValues
fn index(&self, name: HeaderName) -> &HeaderValues
Returns a reference to the value corresponding to the supplied name.
Panics
Panics if the name is not present in Headers
.
type Output = HeaderValues
type Output = HeaderValues
The returned type after indexing.
impl<'a, '_> PartialEq<&'_ String> for HeaderName
impl<'a, '_> PartialEq<&'_ String> for HeaderName
impl<'a> PartialEq<&'a str> for HeaderName
impl<'a> PartialEq<&'a str> for HeaderName
impl PartialEq<HeaderName> for HeaderName
impl PartialEq<HeaderName> for HeaderName
fn eq(&self, other: &HeaderName) -> bool
fn eq(&self, other: &HeaderName) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &HeaderName) -> bool
fn ne(&self, other: &HeaderName) -> bool
This method tests for !=
.
impl PartialEq<String> for HeaderName
impl PartialEq<String> for HeaderName
impl PartialEq<str> for HeaderName
impl PartialEq<str> for HeaderName
impl Eq for HeaderName
impl StructuralEq for HeaderName
impl StructuralPartialEq for HeaderName
Auto Trait Implementations
impl RefUnwindSafe for HeaderName
impl Send for HeaderName
impl Sync for HeaderName
impl Unpin for HeaderName
impl UnwindSafe for HeaderName
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more