Skip to main content

nominal_api/conjure/errors/scout/compute/api/
invalid_bit_operation.rs

1/// The bit operation is invalid due to the index or operand being out of range. Valid range - [0, 63].
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct InvalidBitOperation {
17    #[builder(into)]
18    #[serde(rename = "operationType")]
19    operation_type: String,
20    #[serde(rename = "value")]
21    value: i32,
22}
23impl InvalidBitOperation {
24    /// Constructs a new instance of the type.
25    #[inline]
26    pub fn new(operation_type: impl Into<String>, value: i32) -> Self {
27        Self::builder().operation_type(operation_type).value(value).build()
28    }
29    #[inline]
30    pub fn operation_type(&self) -> &str {
31        &*self.operation_type
32    }
33    #[inline]
34    pub fn value(&self) -> i32 {
35        self.value
36    }
37}
38impl conjure_error::ErrorType for InvalidBitOperation {
39    #[inline]
40    fn code() -> conjure_error::ErrorCode {
41        conjure_error::ErrorCode::InvalidArgument
42    }
43    #[inline]
44    fn name() -> &'static str {
45        "Compute:InvalidBitOperation"
46    }
47    #[inline]
48    fn safe_args() -> &'static [&'static str] {
49        &["operationType", "value"]
50    }
51}