Skip to main content

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

1/// The requested module function could not be found.
2/// This may be because the reference is incorrect or the function is unavailable in the current execution context.
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    PartialEq,
9    Eq,
10    PartialOrd,
11    Ord,
12    Hash
13)]
14#[serde(crate = "conjure_object::serde")]
15#[conjure_object::private::staged_builder::staged_builder]
16#[builder(crate = conjure_object::private::staged_builder, update, inline)]
17pub struct MissingModuleFunction {
18    #[builder(into)]
19    #[serde(rename = "moduleName")]
20    module_name: String,
21    #[builder(into)]
22    #[serde(rename = "moduleVersion")]
23    module_version: String,
24    #[builder(into)]
25    #[serde(rename = "functionName")]
26    function_name: String,
27}
28impl MissingModuleFunction {
29    /// Constructs a new instance of the type.
30    #[inline]
31    pub fn new(
32        module_name: impl Into<String>,
33        module_version: impl Into<String>,
34        function_name: impl Into<String>,
35    ) -> Self {
36        Self::builder()
37            .module_name(module_name)
38            .module_version(module_version)
39            .function_name(function_name)
40            .build()
41    }
42    #[inline]
43    pub fn module_name(&self) -> &str {
44        &*self.module_name
45    }
46    #[inline]
47    pub fn module_version(&self) -> &str {
48        &*self.module_version
49    }
50    #[inline]
51    pub fn function_name(&self) -> &str {
52        &*self.function_name
53    }
54}
55impl conjure_error::ErrorType for MissingModuleFunction {
56    #[inline]
57    fn code() -> conjure_error::ErrorCode {
58        conjure_error::ErrorCode::InvalidArgument
59    }
60    #[inline]
61    fn name() -> &'static str {
62        "Compute:MissingModuleFunction"
63    }
64    #[inline]
65    fn safe_args() -> &'static [&'static str] {
66        &[]
67    }
68}