#[app]Expand description
Attach protocol-neutral application metadata to an impl block.
#[app] is consumed by all protocol macros on the same impl block
(#[server], #[cli], #[http], #[program], etc.). It does not
generate code itself — it passes metadata downstream via an internal
#[__app_meta] helper attribute that the consuming macro removes.
§Fields
| Field | Default | Effect |
|---|---|---|
name | inferred from struct name (kebab-case) | App name used in config file path, CLI header, spec titles |
description | none | Human-readable description for CLI --help, OpenAPI info, etc. |
version | env!("CARGO_PKG_VERSION") | Version string; powers --version; false disables version entirely |
homepage | none | URL used in OpenAPI info.contact.url, OpenRPC info, etc. |
§Example
ⓘ
#[app(
name = "myapp",
description = "Does the thing",
version = "2.1.0",
homepage = "https://myapp.example.com",
)]
#[server]
impl MyApi {
fn list_items(&self) -> Vec<Item> { ... }
}All preset macros also accept these fields inline as a shorthand:
ⓘ
#[server(name = "myapp", description = "Does the thing")]
impl MyApi { ... }