#[non_exhaustive]pub struct Tag {
pub name: String,
pub summary: Option<String>,
pub description: Option<String>,
pub external_docs: Option<ExternalDocs>,
pub parent: Option<String>,
pub kind: Option<String>,
pub extensions: PropMap<String, Value>,
}Expand description
Implements OpenAPI Tag Object.
Tag can be used to provide additional metadata for tags used by path operations.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringName of the tag. Should match to tag of operation.
summary: Option<String>Short summary of the tag, used for display purposes. Added in OpenAPI 3.2 as the
standardized replacement for the x-displayName extension.
description: Option<String>Additional description for the tag shown in the document.
external_docs: Option<ExternalDocs>Additional external documentation for the tag.
parent: Option<String>Tag::name of the tag this tag is nested under. Added in OpenAPI 3.2.
The named tag must exist in the document and circular parent/child references are not allowed; neither condition is validated here.
kind: Option<String>Machine-readable string categorizing what sort of tag this is. Added in OpenAPI 3.2.
Any string is allowed; commonly used values are nav, badge and audience. See the
registry for the well-known values.
extensions: PropMap<String, Value>Optional extensions “x-something”
Implementations§
Source§impl Tag
impl Tag
Sourcepub fn summary(self, summary: impl Into<String>) -> Self
pub fn summary(self, summary: impl Into<String>) -> Self
Add a short summary used for display purposes. Requires OpenAPI 3.2.
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Add additional description for the tag.
Sourcepub fn parent(self, parent: impl Into<String>) -> Self
pub fn parent(self, parent: impl Into<String>) -> Self
Nest this tag under the tag with the given name. Requires OpenAPI 3.2.
Sourcepub fn kind(self, kind: impl Into<String>) -> Self
pub fn kind(self, kind: impl Into<String>) -> Self
Categorize the tag, e.g. nav, badge or audience. Requires OpenAPI 3.2.
Sourcepub fn external_docs(self, external_docs: ExternalDocs) -> Self
pub fn external_docs(self, external_docs: ExternalDocs) -> Self
Add additional external documentation for the tag.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tag
impl<'de> Deserialize<'de> for Tag
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>,
impl Eq for Tag
Source§impl Ord for Tag
impl Ord for Tag
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Tag
impl PartialOrd for Tag
impl StructuralPartialEq for Tag
Auto Trait Implementations§
impl Freeze for Tag
impl RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl UnsafeUnpin for Tag
impl UnwindSafe for Tag
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
key and return true if they are equal.