Struct HeaderField
pub struct HeaderField { /* private fields */ }Expand description
Complete single header field.
Implementations§
§impl HeaderField
impl HeaderField
pub fn new(
name: impl AsRef<str>,
value: impl AsRef<str>,
) -> Result<HeaderField, HeaderParseError>
pub fn new( name: impl AsRef<str>, value: impl AsRef<str>, ) -> Result<HeaderField, HeaderParseError>
Creates a header field from name and value text.
pub const fn name(&self) -> &HeaderName
pub const fn name(&self) -> &HeaderName
Returns the header name.
pub const fn value(&self) -> &HeaderValue
pub const fn value(&self) -> &HeaderValue
Returns the header value.
Trait Implementations§
§impl Clone for HeaderField
impl Clone for HeaderField
§fn clone(&self) -> HeaderField
fn clone(&self) -> HeaderField
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 more§impl Debug for HeaderField
impl Debug for HeaderField
§impl Display for HeaderField
impl Display for HeaderField
§impl FromStr for HeaderField
impl FromStr for HeaderField
§type Err = HeaderParseError
type Err = HeaderParseError
The associated error which can be returned from parsing.
§fn from_str(value: &str) -> Result<HeaderField, <HeaderField as FromStr>::Err>
fn from_str(value: &str) -> Result<HeaderField, <HeaderField as FromStr>::Err>
Parses a string
s to return a value of this type. Read more§impl Hash for HeaderField
impl Hash for HeaderField
§impl Ord for HeaderField
impl Ord for HeaderField
§impl PartialEq for HeaderField
impl PartialEq for HeaderField
§impl PartialOrd for HeaderField
impl PartialOrd for HeaderField
impl Eq for HeaderField
impl StructuralPartialEq for HeaderField
Auto Trait Implementations§
impl Freeze for HeaderField
impl RefUnwindSafe for HeaderField
impl Send for HeaderField
impl Sync for HeaderField
impl Unpin for HeaderField
impl UnsafeUnpin for HeaderField
impl UnwindSafe for HeaderField
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