pub struct LayerContribution { /* private fields */ }Expand description
What a layer contributes to the OpenAPI contract for the
operations it covers. Build with LayerContribution::new and
the chainable with_* setters; empty fields are zero-cost.
Implementations§
Source§impl LayerContribution
impl LayerContribution
Sourcepub fn with_header(self, h: HeaderParam) -> Self
pub fn with_header(self, h: HeaderParam) -> Self
Add a single header to the contribution.
Sourcepub fn with_headers(self, hs: impl IntoIterator<Item = HeaderParam>) -> Self
pub fn with_headers(self, hs: impl IntoIterator<Item = HeaderParam>) -> Self
Add multiple headers to the contribution.
Sourcepub fn with_response(self, r: ResponseContribution) -> Self
pub fn with_response(self, r: ResponseContribution) -> Self
Add a response status the layer can produce.
Sourcepub fn with_security(self, s: SecurityContribution) -> Self
pub fn with_security(self, s: SecurityContribution) -> Self
Add a security requirement the layer enforces.
Sourcepub fn with_tag(self, t: impl Into<String>) -> Self
pub fn with_tag(self, t: impl Into<String>) -> Self
Add a tag the layer applies to its operations.
Sourcepub fn with_badge(self, b: BadgeContribution) -> Self
pub fn with_badge(self, b: BadgeContribution) -> Self
Add a badge the layer attaches to every operation it covers.
Renders as a colored chip on doc UIs that surface
x-badges (Scalar).
Sourcepub fn merge(&mut self, other: LayerContribution)
pub fn merge(&mut self, other: LayerContribution)
Merge another contribution into this one. Order-preserving; dedup happens at apply time, not merge time.
Trait Implementations§
Source§impl Clone for LayerContribution
impl Clone for LayerContribution
Source§fn clone(&self) -> LayerContribution
fn clone(&self) -> LayerContribution
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 LayerContribution
impl Debug for LayerContribution
Source§impl Default for LayerContribution
impl Default for LayerContribution
Source§fn default() -> LayerContribution
fn default() -> LayerContribution
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LayerContribution
impl RefUnwindSafe for LayerContribution
impl Send for LayerContribution
impl Sync for LayerContribution
impl Unpin for LayerContribution
impl UnsafeUnpin for LayerContribution
impl UnwindSafe for LayerContribution
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