pub struct DocHeaderEntry<H: DocumentedHeader>(/* private fields */);Expand description
Generic IntoParams implementor that produces one header
parameter from a DocumentedHeader marker, calling
H::name,
H::description, and
H::example at runtime.
You don’t usually construct this yourself — the #[get] /
#[post] / etc. macros emit it inside the synthesized
#[utoipa::path(params(...))] block whenever a handler signature
contains a crate::Header<H> extractor or a headers(H, ...)
macro argument is supplied.
The runtime-name design (a fn on DocumentedHeader, not a
const) is what makes this possible: the proc-macro can’t call
H::name() during expansion, but the generated params(DocHeaderEntry<H>)
reaches runtime where the call resolves cheaply.
Trait Implementations§
Source§impl<H: DocumentedHeader> IntoParams for DocHeaderEntry<H>
impl<H: DocumentedHeader> IntoParams for DocHeaderEntry<H>
Source§fn into_params(
_parameter_in_provider: impl Fn() -> Option<ParameterIn>,
) -> Vec<Parameter>
fn into_params( _parameter_in_provider: impl Fn() -> Option<ParameterIn>, ) -> Vec<Parameter>
Provide
Vec of openapi::path::Parameters to caller. The result is used in utoipa-gen library to
provide OpenAPI parameter information for the endpoint using the parameters.Auto Trait Implementations§
impl<H> Freeze for DocHeaderEntry<H>
impl<H> RefUnwindSafe for DocHeaderEntry<H>where
H: RefUnwindSafe,
impl<H> Send for DocHeaderEntry<H>where
H: Send,
impl<H> Sync for DocHeaderEntry<H>where
H: Sync,
impl<H> Unpin for DocHeaderEntry<H>where
H: Unpin,
impl<H> UnsafeUnpin for DocHeaderEntry<H>
impl<H> UnwindSafe for DocHeaderEntry<H>where
H: UnwindSafe,
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