Skip to main content

nominal_api/conjure/objects/ingest/api/
file_suffix.rs

1/// The expected suffix of the file. For example, "parquet", "json", "csv", etc.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Deserialize,
6    conjure_object::serde::Serialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash,
12    Default
13)]
14#[serde(crate = "conjure_object::serde", transparent)]
15pub struct FileSuffix(pub String);
16impl std::fmt::Display for FileSuffix {
17    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18        std::fmt::Display::fmt(&self.0, fmt)
19    }
20}
21impl conjure_object::Plain for FileSuffix {
22    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23        conjure_object::Plain::fmt(&self.0, fmt)
24    }
25}
26impl conjure_object::FromPlain for FileSuffix {
27    type Err = <String as conjure_object::FromPlain>::Err;
28    #[inline]
29    fn from_plain(s: &str) -> Result<FileSuffix, Self::Err> {
30        conjure_object::FromPlain::from_plain(s).map(FileSuffix)
31    }
32}
33impl std::convert::From<String> for FileSuffix {
34    #[inline]
35    fn from(v: String) -> Self {
36        FileSuffix(std::convert::From::from(v))
37    }
38}
39impl std::ops::Deref for FileSuffix {
40    type Target = String;
41    #[inline]
42    fn deref(&self) -> &String {
43        &self.0
44    }
45}
46impl std::ops::DerefMut for FileSuffix {
47    #[inline]
48    fn deref_mut(&mut self) -> &mut String {
49        &mut self.0
50    }
51}
52impl std::convert::AsRef<String> for FileSuffix {
53    #[inline]
54    fn as_ref(&self) -> &String {
55        &self.0
56    }
57}