pub struct CustomHeaders(/* private fields */);Expand description
A set of pre-validated user-supplied HTTP headers.
Construction (and the per-name validation that goes with it) happens once
at settings load time. Cloning is Arc-cheap, so providers can hand a copy
to each outgoing request without re-parsing or re-allocating.
Implementations§
Source§impl CustomHeaders
impl CustomHeaders
pub fn new(headers: Vec<(HeaderName, HeaderValue)>) -> Self
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl ExactSizeIterator<Item = (&HeaderName, &HeaderValue)>
Trait Implementations§
Source§impl Clone for CustomHeaders
impl Clone for CustomHeaders
Source§fn clone(&self) -> CustomHeaders
fn clone(&self) -> CustomHeaders
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 CustomHeaders
impl Debug for CustomHeaders
Source§impl Default for CustomHeaders
impl Default for CustomHeaders
Source§fn default() -> CustomHeaders
fn default() -> CustomHeaders
Returns the “default value” for a type. Read more
Source§impl PartialEq for CustomHeaders
impl PartialEq for CustomHeaders
Auto Trait Implementations§
impl Freeze for CustomHeaders
impl RefUnwindSafe for CustomHeaders
impl Send for CustomHeaders
impl Sync for CustomHeaders
impl Unpin for CustomHeaders
impl UnsafeUnpin for CustomHeaders
impl UnwindSafe for CustomHeaders
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more