Skip to main content

nominal_api/conjure/errors/module/
function_name_conflict.rs

1/// One or more function names conflict with each other in the module definition.
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 FunctionNameConflict {
17    #[builder(default, set(item(type = String, into)))]
18    #[serde(
19        rename = "functionNames",
20        skip_serializing_if = "std::collections::BTreeSet::is_empty",
21        default
22    )]
23    function_names: std::collections::BTreeSet<String>,
24}
25impl FunctionNameConflict {
26    /// Constructs a new instance of the type.
27    #[inline]
28    pub fn new() -> Self {
29        Self::builder().build()
30    }
31    #[inline]
32    pub fn function_names(&self) -> &std::collections::BTreeSet<String> {
33        &self.function_names
34    }
35}
36impl conjure_error::ErrorType for FunctionNameConflict {
37    #[inline]
38    fn code() -> conjure_error::ErrorCode {
39        conjure_error::ErrorCode::Conflict
40    }
41    #[inline]
42    fn name() -> &'static str {
43        "Module:FunctionNameConflict"
44    }
45    #[inline]
46    fn safe_args() -> &'static [&'static str] {
47        &[]
48    }
49}