pub struct HeaderField { /* private fields */ }Expand description
Complete single header field.
Implementations§
Source§impl HeaderField
impl HeaderField
Sourcepub 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.
Sourcepub const fn name(&self) -> &HeaderName
pub const fn name(&self) -> &HeaderName
Returns the header name.
Sourcepub const fn value(&self) -> &HeaderValue
pub const fn value(&self) -> &HeaderValue
Returns the header value.
Trait Implementations§
Source§impl Clone for HeaderField
impl Clone for HeaderField
Source§fn clone(&self) -> HeaderField
fn clone(&self) -> HeaderField
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 HeaderField
impl Debug for HeaderField
Source§impl Display for HeaderField
impl Display for HeaderField
Source§impl FromStr for HeaderField
impl FromStr for HeaderField
Source§type Err = HeaderParseError
type Err = HeaderParseError
The associated error which can be returned from parsing.
Source§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 moreSource§impl Hash for HeaderField
impl Hash for HeaderField
Source§impl Ord for HeaderField
impl Ord for HeaderField
Source§fn cmp(&self, other: &HeaderField) -> Ordering
fn cmp(&self, other: &HeaderField) -> Ordering
1.21.0 (const: unstable) · 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 HeaderField
impl PartialEq for HeaderField
Source§fn eq(&self, other: &HeaderField) -> bool
fn eq(&self, other: &HeaderField) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§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