Skip to main content

nominal_api/conjure/objects/scout/compute/api/
error_result.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct ErrorResult {
16    #[serde(rename = "errorType")]
17    error_type: super::ErrorType,
18    #[serde(rename = "code")]
19    code: super::ErrorCode,
20}
21impl ErrorResult {
22    /// Constructs a new instance of the type.
23    #[inline]
24    pub fn new(error_type: super::ErrorType, code: super::ErrorCode) -> Self {
25        Self::builder().error_type(error_type).code(code).build()
26    }
27    #[inline]
28    pub fn error_type(&self) -> &super::ErrorType {
29        &self.error_type
30    }
31    #[inline]
32    pub fn code(&self) -> super::ErrorCode {
33        self.code
34    }
35}