apple_clis/xcrun/simctl/install/
output.rs

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