MCPcopy Create free account
hub / github.com/hashintel/hash / from_specta

Method from_specta

libs/@local/codegen/src/definitions/enum.rs:27–37  ·  view source on GitHub ↗
(enum_repr: &datatype::EnumRepr)

Source from the content-addressed store, hash-verified

25
26impl 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)]

Callers

nothing calls this directly

Calls 7

collectMethod · 0.80
variantsMethod · 0.80
fieldsMethod · 0.80
cloneMethod · 0.45
mapMethod · 0.45
filterMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected