pacenotes_server/store/generated.rs
1/// A generated manifest and what the publisher should look at, collected so
2/// the CLI prints them together and tests can assert on them.
3#[derive(Debug)]
4pub struct Generated {
5 pub manifest: pacenotes_shared::Manifest,
6 /// Published anyway, but worth a look: a mis-filed level, a name that needs encoding.
7 pub warnings: Vec<String>,
8 /// Withheld from the manifest, such as a broken sidecar's package; the rest
9 /// still publishes, but the run exits non-zero.
10 pub errors: Vec<String>,
11}
12
13impl Generated {
14 pub(super) fn warn(&mut self, message: String) {
15 tracing::warn!("{message}");
16 self.warnings.push(message);
17 }
18
19 pub(super) fn error(&mut self, message: String) {
20 tracing::error!("{message}");
21 self.errors.push(message);
22 }
23}