pub enum HeaderValue<'a> {
StrRef(&'a str),
Str(String),
NumberUsize(usize),
}
Expand description
A single HeaderValue that can hold Data in a variety of forms allowing for easier and more flexible use
Variants§
StrRef(&'a str)
Stores the Value as a reference to a String
Str(String)
Stores the Value as an owned String
NumberUsize(usize)
Stores the Value in its raw Number format
Implementations§
Source§impl<'a> HeaderValue<'a>
impl<'a> HeaderValue<'a>
Sourcepub fn serialize(&self, buf: &mut Vec<u8>)
pub fn serialize(&self, buf: &mut Vec<u8>)
Serializes the Value into the given Buffer by appending the Data to it
Sourcepub fn to_string(&self) -> String
pub fn to_string(&self) -> String
Turns the given Value, regardless of how it is stored, into an owned String
Sourcepub fn eq_ignore_case(&self, other: &Self) -> bool
pub fn eq_ignore_case(&self, other: &Self) -> bool
Compares the Two values without case
Any number type in either of them immediately returns false
Sourcepub fn try_as_str_ref(&self) -> Option<&str>
pub fn try_as_str_ref(&self) -> Option<&str>
Tries to return a reference to the underlying String, if it is a String, otherwise returns None
Sourcepub fn to_owned<'refed, 'owned>(&'refed self) -> HeaderValue<'owned>
pub fn to_owned<'refed, 'owned>(&'refed self) -> HeaderValue<'owned>
Clones all the needed Data in order to create a new HeaderValue that is completly independant of the given self reference
Trait Implementations§
Source§impl<'a> Clone for HeaderValue<'a>
impl<'a> Clone for HeaderValue<'a>
Source§fn clone(&self) -> HeaderValue<'a>
fn clone(&self) -> HeaderValue<'a>
Returns a duplicate 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<'a> Debug for HeaderValue<'a>
impl<'a> Debug for HeaderValue<'a>
Source§impl<'a> From<&'a str> for HeaderValue<'a>
impl<'a> From<&'a str> for HeaderValue<'a>
Source§impl<'a> From<String> for HeaderValue<'a>
impl<'a> From<String> for HeaderValue<'a>
Source§impl<'a> From<usize> for HeaderValue<'a>
impl<'a> From<usize> for HeaderValue<'a>
Source§impl PartialEq<String> for HeaderValue<'_>
impl PartialEq<String> for HeaderValue<'_>
Source§impl<'a> PartialEq for HeaderValue<'a>
impl<'a> PartialEq for HeaderValue<'a>
impl<'a> StructuralPartialEq for HeaderValue<'a>
Auto Trait Implementations§
impl<'a> Freeze for HeaderValue<'a>
impl<'a> RefUnwindSafe for HeaderValue<'a>
impl<'a> Send for HeaderValue<'a>
impl<'a> Sync for HeaderValue<'a>
impl<'a> Unpin for HeaderValue<'a>
impl<'a> UnwindSafe for HeaderValue<'a>
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