Skip to main content

nominal_api/conjure/errors/module/
invalid_module_version_string.rs

1/// The provided module version string is invalid.
2/// Module version strings must be of the form "MAJOR", where MAJOR is a non-negative integer.
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 InvalidModuleVersionString {
18    #[builder(into)]
19    #[serde(rename = "version")]
20    version: String,
21}
22impl InvalidModuleVersionString {
23    /// Constructs a new instance of the type.
24    #[inline]
25    pub fn new(version: impl Into<String>) -> Self {
26        Self::builder().version(version).build()
27    }
28    #[inline]
29    pub fn version(&self) -> &str {
30        &*self.version
31    }
32}
33impl conjure_error::ErrorType for InvalidModuleVersionString {
34    #[inline]
35    fn code() -> conjure_error::ErrorCode {
36        conjure_error::ErrorCode::InvalidArgument
37    }
38    #[inline]
39    fn name() -> &'static str {
40        "Module:InvalidModuleVersionString"
41    }
42    #[inline]
43    fn safe_args() -> &'static [&'static str] {
44        &[]
45    }
46}