Struct wiremock::http::HeaderName
source · pub struct HeaderName(_);
Expand description
A header name.
Implementations§
source§impl HeaderName
impl HeaderName
sourcepub 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.
sourcepub 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.
sourcepub 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§
source§impl Clone for HeaderName
impl Clone for HeaderName
source§fn clone(&self) -> HeaderName
fn clone(&self) -> HeaderName
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for HeaderName
impl Debug for HeaderName
source§impl Display for HeaderName
impl Display for HeaderName
source§impl<'a> From<&'a str> for HeaderName
impl<'a> From<&'a str> for HeaderName
source§fn from(value: &'a str) -> HeaderName
fn from(value: &'a str) -> HeaderName
Converts to this type from the input type.
source§impl From<&HeaderName> for HeaderName
impl From<&HeaderName> for HeaderName
source§fn from(value: &HeaderName) -> HeaderName
fn from(value: &HeaderName) -> HeaderName
Converts to this type from the input type.
source§impl FromStr for HeaderName
impl FromStr for HeaderName
source§impl Hash for HeaderName
impl Hash for HeaderName
source§impl Index<HeaderName> for Headers
impl Index<HeaderName> for Headers
source§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.
source§impl<'a> PartialEq<&'a str> for HeaderName
impl<'a> PartialEq<&'a str> for HeaderName
source§impl<'a> PartialEq<&String> for HeaderName
impl<'a> PartialEq<&String> for HeaderName
source§impl PartialEq<HeaderName> for HeaderName
impl PartialEq<HeaderName> for HeaderName
source§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 ==
.source§impl PartialEq<String> for HeaderName
impl PartialEq<String> for HeaderName
source§impl PartialEq<str> for HeaderName
impl PartialEq<str> for HeaderName
source§impl TryFrom<HeaderName> for HeaderName
impl TryFrom<HeaderName> for HeaderName
source§fn try_from(
name: HeaderName
) -> Result<HeaderName, <HeaderName as TryFrom<HeaderName>>::Error>
fn try_from( name: HeaderName ) -> Result<HeaderName, <HeaderName as TryFrom<HeaderName>>::Error>
Performs the conversion.
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§
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.