#[non_exhaustive]pub enum StructuredOutput {
BuildFinished {
path: PathBuf,
},
BuildUpdate {
stage: BuildStage,
},
CargoOutput {
message: CompilerMessage,
},
BundleOutput {
bundles: Vec<PathBuf>,
},
HtmlTranslate {
html: String,
},
Success,
Error {
message: String,
},
}
Expand description
The structured output for the CLI
This is designed such that third party tools can reliably consume the output of the CLI when outputting json.
Not every log outputted will be parsable, but all structured logs should be.
This means the debug format of this log needs to be parsable json, not the default debug format.
We guarantee that the last line of the command represents the success of the command, such that tools can simply parse the last line of the output.
There might be intermediate lines that are parseable as structured logs (which you can put here) but they are not guaranteed to be, such that we can provide better error messages for the user.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
BuildFinished
BuildUpdate
Fields
§
stage: BuildStage
CargoOutput
Fields
§
message: CompilerMessage
BundleOutput
HtmlTranslate
Success
Error
Trait Implementations§
Source§impl Clone for StructuredOutput
impl Clone for StructuredOutput
Source§fn clone(&self) -> StructuredOutput
fn clone(&self) -> StructuredOutput
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StructuredOutput
impl Debug for StructuredOutput
Source§impl<'de> Deserialize<'de> for StructuredOutput
impl<'de> Deserialize<'de> for StructuredOutput
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for StructuredOutput
impl RefUnwindSafe for StructuredOutput
impl Send for StructuredOutput
impl Sync for StructuredOutput
impl Unpin for StructuredOutput
impl UnwindSafe for StructuredOutput
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
Mutably borrows from an owned value. Read more