Struct headers::util::value_string::HeaderValueString
source · pub(crate) struct HeaderValueString {
value: HeaderValue,
}
Expand description
A value that is both a valid HeaderValue
and String
.
Fields§
§value: HeaderValue
Care must be taken to only set this value when it is also
a valid String
, since as_str
will convert to a &str
in an unchecked manner.
Implementations§
source§impl HeaderValueString
impl HeaderValueString
pub(crate) fn from_val(val: &HeaderValue) -> Result<Self, Error>
pub(crate) fn from_string(src: String) -> Option<Self>
pub(crate) fn from_static(src: &'static str) -> HeaderValueString
pub(crate) fn as_str(&self) -> &str
Trait Implementations§
source§impl Clone for HeaderValueString
impl Clone for HeaderValueString
source§fn clone(&self) -> HeaderValueString
fn clone(&self) -> HeaderValueString
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 HeaderValueString
impl Debug for HeaderValueString
source§impl Display for HeaderValueString
impl Display for HeaderValueString
source§impl<'a> From<&'a HeaderValueString> for HeaderValue
impl<'a> From<&'a HeaderValueString> for HeaderValue
source§fn from(src: &'a HeaderValueString) -> HeaderValue
fn from(src: &'a HeaderValueString) -> HeaderValue
Converts to this type from the input type.
source§impl FromStr for HeaderValueString
impl FromStr for HeaderValueString
source§impl Hash for HeaderValueString
impl Hash for HeaderValueString
source§impl Ord for HeaderValueString
impl Ord for HeaderValueString
source§fn cmp(&self, other: &HeaderValueString) -> Ordering
fn cmp(&self, other: &HeaderValueString) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for HeaderValueString
impl PartialEq for HeaderValueString
source§impl PartialOrd for HeaderValueString
impl PartialOrd for HeaderValueString
source§impl TryFromValues for HeaderValueString
impl TryFromValues for HeaderValueString
source§fn try_from_values<'i, I>(values: &mut I) -> Result<Self, Error>where
I: Iterator<Item = &'i HeaderValue>,
fn try_from_values<'i, I>(values: &mut I) -> Result<Self, Error>where
I: Iterator<Item = &'i HeaderValue>,
Try to convert from the values into an instance of
Self
.impl Eq for HeaderValueString
impl StructuralPartialEq for HeaderValueString
Auto Trait Implementations§
impl !Freeze for HeaderValueString
impl RefUnwindSafe for HeaderValueString
impl Send for HeaderValueString
impl Sync for HeaderValueString
impl Unpin for HeaderValueString
impl UnwindSafe for HeaderValueString
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)