rust_jsr_registry/types/
graph.rs1#[cfg(feature = "unstable")]
5pub mod one {}
6
7pub mod two {
9 use serde::{Deserialize, Serialize};
10
11 use crate::{priv_as_ref, priv_enum_derived};
12
13 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
15 pub struct ModuleGraph2 {
16 pub dependencies: Option<Vec<Dependency>>,
18 }
19 priv_as_ref!(ModuleGraph2);
20
21 priv_enum_derived!(DependencyType, Static, Dynamic);
22 priv_enum_derived!(DependencyKind, Import, Export);
23
24 #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
25 #[serde(rename_all = "camelCase")]
26 pub struct Dependency {
28 pub r#type: DependencyType,
30 pub kind: DependencyKind,
32 pub specifier: String,
34 pub specifier_range: ((u32, u32), (u32, u32))
41 }
42 impl PartialOrd for Dependency {
43 fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
44 self.specifier_range.partial_cmp(&other.specifier_range)
45 }
46 }
47 impl Ord for Dependency {
48 fn cmp(&self, other: &Self) -> std::cmp::Ordering {
49 self.specifier_range.cmp(&other.specifier_range)
50 }
51 }
52 priv_as_ref!(Dependency);
53}