ToolMetadata fields this family reads¶
ToolMetadata and VersionInfo are defined in
rtb-app; this page documents only what the
four crates in this repo do with them. Build both with their builders:
use rtb_app::prelude::*;
let metadata = ToolMetadata::builder()
.name("mytool")
.summary("does the thing")
.build();
name and summary are required at compile time. Everything else has a default.
Fields that shape the CLI¶
| Field | Default | What reads it |
|---|---|---|
name |
required | Clap command name; the tool name in version output; the config, consent and cache directory names; the telemetry env-var prefix; the binary name searched for in an update archive |
summary |
required | Clap about |
description |
"" |
Clap long_about, only when non-empty |
help |
HelpChannel::None |
The support footer installed under every error diagnostic |
HelpChannel renders one of:
HelpChannel::None installs no footer.
Fields that shape self-update¶
| Field | Default | Effect |
|---|---|---|
release_source |
None |
Required by update check, update run and the pre-run policy hook |
release_credential |
None |
Token for a private release source, resolved at update time |
update_public_keys |
empty | Trusted minisign public keys. Empty means update run refuses to run |
update_asset_pattern |
None → {name}-{version}-{target}{ext} |
Asset-name template |
update_checksums_asset |
None |
Name of a sha256sum-format asset. When None, no checksum is verified at all |
update_policy |
Disabled |
Automatic pre-run checks |
update_check_interval |
24 hours | Throttle for those checks |
release_source variants¶
| Variant | Required fields | Host default |
|---|---|---|
Github |
owner, repo |
github.com |
Gitlab |
project (<owner>/<repo>, may be nested) |
gitlab.com |
Bitbucket |
workspace, repo_slug |
api.bitbucket.org/2.0 |
Gitea |
owner, repo, host |
none — host is required |
Codeberg |
owner, repo |
fixed |
Direct |
url_template |
n/a |
A Gitlab project string without a / fails with
update: gitlab `project` must include the owner (`<owner>/<repo>`). Every
variant is mapped with private: false and a 30-second timeout, and neither is
configurable through ToolMetadata.
For Direct, the same url_template is used as both the version URL and the asset
URL template.
If rtb-forge was compiled without the backend feature for the chosen variant, the
lookup fails with no provider registered for source_type=....
update_public_keys¶
Base64 minisign public keys — the same string a minisign.pub carries and the same
one pinned as pubkey under [package.metadata.binstall.signing].
Any one key verifying is enough, so shipping {old, new} spans a rotation. Entries
that fail to parse are skipped; if every entry fails, that is reported as
rtb::update::malformed_public_key rather than a signature failure, because the
fault is in the binary's own trust set and not in the download.
Fields that shape telemetry¶
| Field | Default | Effect |
|---|---|---|
telemetry_notice |
None |
Printed by telemetry enable. When None, a generic message is printed that also says no notice was configured |
VersionInfo¶
| Field | Set by | Shown by version |
|---|---|---|
version |
version_info!(), from CARGO_PKG_VERSION |
always |
commit |
your build.rs |
when Some |
date |
your build.rs |
when Some |
version_info!() sets only version. Populating commit and date needs a build
script — vergen or built are the usual choices.
version is also the version update check compares against the release tag, so a
Cargo.toml version that does not match your release tags makes every check report
a mismatch.