Struct wiremock::http::HeaderName
source · [−]pub struct HeaderName(_);
Expand description
A header name.
Implementations
sourceimpl 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
sourceimpl Clone for HeaderName
impl Clone for HeaderName
sourcepub fn clone(&self) -> HeaderName
pub 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
sourceimpl Debug for HeaderName
impl Debug for HeaderName
sourceimpl Display for HeaderName
impl Display for HeaderName
sourceimpl<'_> From<&'_ HeaderName> for HeaderName
impl<'_> From<&'_ HeaderName> for HeaderName
sourcepub fn from(value: &HeaderName) -> HeaderName
pub fn from(value: &HeaderName) -> HeaderName
Performs the conversion.
sourceimpl<'a> From<&'a str> for HeaderName
impl<'a> From<&'a str> for HeaderName
sourcepub fn from(value: &'a str) -> HeaderName
pub fn from(value: &'a str) -> HeaderName
Performs the conversion.
sourceimpl FromStr for HeaderName
impl FromStr for HeaderName
sourcepub fn from_str(s: &str) -> Result<HeaderName, <HeaderName as FromStr>::Err>
pub fn from_str(s: &str) -> Result<HeaderName, <HeaderName as FromStr>::Err>
Create a new HeaderName
.
This checks it’s valid ASCII, and lowercases it.
sourceimpl Hash for HeaderName
impl Hash for HeaderName
sourceimpl Index<HeaderName> for Headers
impl Index<HeaderName> for Headers
sourcepub fn index(&self, name: HeaderName) -> &HeaderValues
pub 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.
sourceimpl<'a, '_> PartialEq<&'_ String> for HeaderName
impl<'a, '_> PartialEq<&'_ String> for HeaderName
sourceimpl<'a> PartialEq<&'a str> for HeaderName
impl<'a> PartialEq<&'a str> for HeaderName
sourceimpl PartialEq<HeaderName> for HeaderName
impl PartialEq<HeaderName> for HeaderName
sourcepub fn eq(&self, other: &HeaderName) -> bool
pub fn eq(&self, other: &HeaderName) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcepub fn ne(&self, other: &HeaderName) -> bool
pub fn ne(&self, other: &HeaderName) -> bool
This method tests for !=
.
sourceimpl PartialEq<String> for HeaderName
impl PartialEq<String> for HeaderName
sourceimpl PartialEq<str> for HeaderName
impl PartialEq<str> for HeaderName
sourceimpl TryFrom<HeaderName> for HeaderName
impl TryFrom<HeaderName> for HeaderName
sourcepub fn try_from(
name: HeaderName
) -> Result<HeaderName, <HeaderName as TryFrom<HeaderName>>::Error>
pub 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more