apple_clis/spctl/assess/
output.rs1use crate::prelude::*;
2
3#[derive(Debug, Serialize)]
4#[non_exhaustive]
5#[must_use = include_doc!(must_use_cmd_output)]
6pub enum AssessOutput {
7 #[doc = include_doc!(cmd_error)]
8 ErrorUnImplemented { stderr: String },
9
10 #[doc = include_doc!(cmd_success)]
11 SuccessUnImplemented { stdout: String },
12}
13
14impl CommandNomParsable for AssessOutput {
15 fn error_unimplemented(stderr: String) -> Self {
16 Self::ErrorUnImplemented { stderr }
17 }
18
19 fn success_unimplemented(stdout: String) -> Self {
20 Self::SuccessUnImplemented { stdout }
21 }
22}
23
24impl PublicCommandOutput for AssessOutput {
25 type PrimarySuccess = ();
26
27 fn success(&self) -> Result<&Self::PrimarySuccess> {
28 match self {
29 AssessOutput::SuccessUnImplemented { .. } => Ok(&()),
30 AssessOutput::ErrorUnImplemented { .. } => Err(Error::output_errored(self)),
31 }
32 }
33}