pub struct HeaderParam { /* private fields */ }Expand description
One header parameter descriptor. Construct via
HeaderParam::typed / HeaderParam::typed_optional for
type-safe declarations driven by DocumentedHeader, or via
HeaderParam::required / HeaderParam::optional for ad-hoc
string names.
Implementations§
Source§impl HeaderParam
impl HeaderParam
Sourcepub fn typed<H: DocumentedHeader>() -> Self
pub fn typed<H: DocumentedHeader>() -> Self
Build a required header from a DocumentedHeader marker.
Resolves the name and metadata at the time of the call.
Sourcepub fn typed_optional<H: DocumentedHeader>() -> Self
pub fn typed_optional<H: DocumentedHeader>() -> Self
Build an optional header from a DocumentedHeader marker.
Sourcepub fn required(name: impl Into<String>) -> Self
pub fn required(name: impl Into<String>) -> Self
Build an ad-hoc required header from a string name. Prefer
HeaderParam::typed when a marker type is available.
Sourcepub fn optional(name: impl Into<String>) -> Self
pub fn optional(name: impl Into<String>) -> Self
Build an ad-hoc optional header from a string name.
Sourcepub fn description(self, d: impl Into<String>) -> Self
pub fn description(self, d: impl Into<String>) -> Self
Set the description (chainable).
Trait Implementations§
Source§impl Clone for HeaderParam
impl Clone for HeaderParam
Source§fn clone(&self) -> HeaderParam
fn clone(&self) -> HeaderParam
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 moreAuto Trait Implementations§
impl Freeze for HeaderParam
impl RefUnwindSafe for HeaderParam
impl Send for HeaderParam
impl Sync for HeaderParam
impl Unpin for HeaderParam
impl UnsafeUnpin for HeaderParam
impl UnwindSafe for HeaderParam
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