(enum_repr: &datatype::EnumRepr)
| 25 | |
| 26 | impl EnumTagging { |
| 27 | pub(crate) fn from_specta(enum_repr: &datatype::EnumRepr) -> Self { |
| 28 | match enum_repr { |
| 29 | datatype::EnumRepr::Untagged => Self::Untagged, |
| 30 | datatype::EnumRepr::Internal { tag } => Self::Internal { tag: tag.clone() }, |
| 31 | datatype::EnumRepr::External => Self::External, |
| 32 | datatype::EnumRepr::Adjacent { tag, content } => Self::Adjacent { |
| 33 | tag: tag.clone(), |
| 34 | content: content.clone(), |
| 35 | }, |
| 36 | } |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | #[derive(Debug, Clone)] |