Skip to main content

nominal_api/conjure/errors/datasource/api/
prefix_tree_too_large.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    Copy
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 PrefixTreeTooLarge {
17    #[serde(rename = "numNodes")]
18    num_nodes: i32,
19    #[serde(rename = "maxNodes")]
20    max_nodes: i32,
21}
22impl PrefixTreeTooLarge {
23    /// Constructs a new instance of the type.
24    #[inline]
25    pub fn new(num_nodes: i32, max_nodes: i32) -> Self {
26        Self::builder().num_nodes(num_nodes).max_nodes(max_nodes).build()
27    }
28    #[inline]
29    pub fn num_nodes(&self) -> i32 {
30        self.num_nodes
31    }
32    #[inline]
33    pub fn max_nodes(&self) -> i32 {
34        self.max_nodes
35    }
36}
37impl conjure_error::ErrorType for PrefixTreeTooLarge {
38    #[inline]
39    fn code() -> conjure_error::ErrorCode {
40        conjure_error::ErrorCode::InvalidArgument
41    }
42    #[inline]
43    fn name() -> &'static str {
44        "DataSource:PrefixTreeTooLarge"
45    }
46    #[inline]
47    fn safe_args() -> &'static [&'static str] {
48        &["maxNodes", "numNodes"]
49    }
50}