Skip to main content

nominal_api/conjure/errors/module/
invalid_nested_function_references.rs

1/// One or more functions contain invalid nested function references.
2/// Functions cannot reference other functions that are not defined in the same module.
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 InvalidNestedFunctionReferences {
18    #[builder(default, set(item(type = String, into)))]
19    #[serde(
20        rename = "functionName",
21        skip_serializing_if = "std::collections::BTreeSet::is_empty",
22        default
23    )]
24    function_name: std::collections::BTreeSet<String>,
25}
26impl InvalidNestedFunctionReferences {
27    /// Constructs a new instance of the type.
28    #[inline]
29    pub fn new() -> Self {
30        Self::builder().build()
31    }
32    #[inline]
33    pub fn function_name(&self) -> &std::collections::BTreeSet<String> {
34        &self.function_name
35    }
36}
37impl conjure_error::ErrorType for InvalidNestedFunctionReferences {
38    #[inline]
39    fn code() -> conjure_error::ErrorCode {
40        conjure_error::ErrorCode::InvalidArgument
41    }
42    #[inline]
43    fn name() -> &'static str {
44        "Module:InvalidNestedFunctionReferences"
45    }
46    #[inline]
47    fn safe_args() -> &'static [&'static str] {
48        &[]
49    }
50}