跳到主要内容
本页尚未翻译

下面显示的是英文原文。

Tag

A Tag is a label that groups the service among its neighbours, with an optional description and link.

AppInfo::tag adds one; each call adds another. Tag::new takes the label. description says what it means, and external_docs where it is documented. The document also tags each operation with the protocol of its server. The example runs with cargo test --example asyncapi_info --no-default-features --features asyncapi.

Example​

/// The domain the service belongs to among its neighbours.
fn tag() -> Tag {
Tag::new("payments")
.description("Everything that moves money")
.external_docs(ExternalDocs::new("https://example.com/domains/payments"))
}