1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
use weavatrix_graph::{EdgeKind, NodeKind}; #[must_use] pub(super) fn abi_kind() -> NodeKind { NodeKind::custom("web3.abi").unwrap_or(NodeKind::Module) } #[must_use] pub(super) fn function_kind() -> NodeKind { NodeKind::custom("web3.abi.function").unwrap_or(NodeKind::Function) } #[must_use] pub(super) fn event_kind() -> NodeKind { NodeKind::custom("web3.abi.event").unwrap_or(NodeKind::Function) } #[must_use] pub(super) fn error_kind() -> NodeKind { NodeKind::custom("web3.abi.error").unwrap_or(NodeKind::TypeAlias) } #[must_use] pub(super) fn constructor_kind() -> NodeKind { NodeKind::custom("web3.abi.constructor").unwrap_or(NodeKind::Function) } #[must_use] pub(super) fn artifact_kind() -> NodeKind { NodeKind::custom("web3.artifact").unwrap_or(NodeKind::Module) } #[must_use] pub(super) fn consumer_kind() -> NodeKind { NodeKind::custom("web3.consumer").unwrap_or(NodeKind::Function) } #[must_use] pub(crate) fn binds() -> EdgeKind { EdgeKind::custom("web3.binds").unwrap_or(EdgeKind::Reads) } #[must_use] pub(super) fn member_kind(kind: &str) -> NodeKind { match kind { "function" => function_kind(), "event" => event_kind(), "error" => error_kind(), "constructor" | "fallback" | "receive" => constructor_kind(), _ => abi_kind(), } }