nominal_api/conjure/objects/api/
mcap_channel_id.rs1#[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)]
14#[serde(crate = "conjure_object::serde", transparent)]
15pub struct McapChannelId(pub i32);
16impl std::fmt::Display for McapChannelId {
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 McapChannelId {
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 McapChannelId {
27 type Err = <i32 as conjure_object::FromPlain>::Err;
28 #[inline]
29 fn from_plain(s: &str) -> Result<McapChannelId, Self::Err> {
30 conjure_object::FromPlain::from_plain(s).map(McapChannelId)
31 }
32}
33impl std::convert::From<i32> for McapChannelId {
34 #[inline]
35 fn from(v: i32) -> Self {
36 McapChannelId(std::convert::From::from(v))
37 }
38}
39impl std::ops::Deref for McapChannelId {
40 type Target = i32;
41 #[inline]
42 fn deref(&self) -> &i32 {
43 &self.0
44 }
45}
46impl std::ops::DerefMut for McapChannelId {
47 #[inline]
48 fn deref_mut(&mut self) -> &mut i32 {
49 &mut self.0
50 }
51}
52impl std::convert::AsRef<i32> for McapChannelId {
53 #[inline]
54 fn as_ref(&self) -> &i32 {
55 &self.0
56 }
57}