apple_clis/ios_deploy/upload/
output.rs

1use crate::prelude::*;
2
3#[derive(Debug, Serialize)]
4#[non_exhaustive]
5#[must_use = include_doc!(must_use_cmd_output)]
6pub enum UploadOutput {
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 UploadOutput {
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 UploadOutput {
25	type PrimarySuccess = ();
26
27	fn success(&self) -> Result<&Self::PrimarySuccess> {
28		match self {
29			UploadOutput::SuccessUnImplemented { .. } => Ok(&()),
30			UploadOutput::ErrorUnImplemented { .. } => Err(Error::output_errored(self)),
31		}
32	}
33}