#[non_exhaustive]pub struct HttpHeaderOption {
pub header_name: Option<String>,
pub header_value: Option<String>,
pub replace: Option<bool>,
/* private fields */
}Available on crate features
region-url-maps or url-maps only.Expand description
Specification determining how headers are added to requests or responses.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.header_name: Option<String>The name of the header.
header_value: Option<String>The value of the header to add.
replace: Option<bool>If false, headerValue is appended to any values that already exist for the header. If true, headerValue is set for the header, discarding any values that were set for that header.
The default value is true, unless a variable is present in headerValue, in which case the default value is false. .
Implementations§
Source§impl HttpHeaderOption
impl HttpHeaderOption
pub fn new() -> Self
Sourcepub fn set_header_name<T>(self, v: T) -> Self
pub fn set_header_name<T>(self, v: T) -> Self
Sets the value of header_name.
§Example
ⓘ
let x = HttpHeaderOption::new().set_header_name("example");Sourcepub fn set_or_clear_header_name<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_header_name<T>(self, v: Option<T>) -> Self
Sets or clears the value of header_name.
§Example
ⓘ
let x = HttpHeaderOption::new().set_or_clear_header_name(Some("example"));
let x = HttpHeaderOption::new().set_or_clear_header_name(None::<String>);Sourcepub fn set_header_value<T>(self, v: T) -> Self
pub fn set_header_value<T>(self, v: T) -> Self
Sets the value of header_value.
§Example
ⓘ
let x = HttpHeaderOption::new().set_header_value("example");Sourcepub fn set_or_clear_header_value<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_header_value<T>(self, v: Option<T>) -> Self
Sets or clears the value of header_value.
§Example
ⓘ
let x = HttpHeaderOption::new().set_or_clear_header_value(Some("example"));
let x = HttpHeaderOption::new().set_or_clear_header_value(None::<String>);Sourcepub fn set_replace<T>(self, v: T) -> Self
pub fn set_replace<T>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for HttpHeaderOption
impl Clone for HttpHeaderOption
Source§fn clone(&self) -> HttpHeaderOption
fn clone(&self) -> HttpHeaderOption
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 Debug for HttpHeaderOption
impl Debug for HttpHeaderOption
Source§impl Default for HttpHeaderOption
impl Default for HttpHeaderOption
Source§fn default() -> HttpHeaderOption
fn default() -> HttpHeaderOption
Returns the “default value” for a type. Read more
Source§impl Message for HttpHeaderOption
impl Message for HttpHeaderOption
Source§impl PartialEq for HttpHeaderOption
impl PartialEq for HttpHeaderOption
impl StructuralPartialEq for HttpHeaderOption
Auto Trait Implementations§
impl Freeze for HttpHeaderOption
impl RefUnwindSafe for HttpHeaderOption
impl Send for HttpHeaderOption
impl Sync for HttpHeaderOption
impl Unpin for HttpHeaderOption
impl UnwindSafe for HttpHeaderOption
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