pub struct Header {
pub name: String,
pub value: String,
}Expand description
A validated HTTP header pair that can be persisted in a task sidecar.
Fields§
§name: StringHeader name, trimmed and validated as an HTTP header name.
value: StringHeader value, trimmed. May contain ${env:NAME} placeholders that
backends expand when building the request.
Implementations§
Source§impl Header
impl Header
Sourcepub fn new(name: impl AsRef<str>, value: impl AsRef<str>) -> Result<Self>
pub fn new(name: impl AsRef<str>, value: impl AsRef<str>) -> Result<Self>
Trim and validate the pair, rejecting malformed HTTP header names and
values with Error::Config.
Sourcepub fn is_sensitive(&self) -> bool
pub fn is_sensitive(&self) -> bool
Whether the header is one of the credential-bearing names
(authorization, cookie, proxy-authorization, x-api-key),
compared case-insensitively.
Sourcepub fn redacted(&self) -> Self
pub fn redacted(&self) -> Self
Clone the header, replacing the value with <redacted> when
is_sensitive is true.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Header
impl<'de> Deserialize<'de> for Header
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Forget for Header
impl Freeze for Header
impl Move for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnsafeUnpin for Header
impl UnwindSafe for Header
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.