Skip to main content

nominal_api_conjure/conjure/objects/api/
mcap_channel_id.rs

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