chore: import upstream snapshot with attribution
CI / test (3.10) (push) Failing after 1s
CI / test (3.12) (push) Failing after 0s
CI / skillgen-check (push) Failing after 0s
CI / security-scan (push) Failing after 0s

This commit is contained in:
wehub-resource-sync
2026-07-13 12:09:14 +08:00
commit d88fd01084
727 changed files with 235247 additions and 0 deletions
+60
View File
@@ -0,0 +1,60 @@
use std::collections::HashMap;
struct Graph {
nodes: HashMap<String, Vec<String>>,
}
impl Graph {
fn new() -> Self {
Graph { nodes: HashMap::new() }
}
fn add_node(&mut self, id: String) {
self.nodes.insert(id, vec![]);
}
fn add_edge(&mut self, src: String, tgt: String) {
self.nodes.entry(src).or_default().push(tgt);
}
}
fn build_graph(edges: Vec<(String, String)>) -> Graph {
let mut g = Graph::new();
for (src, tgt) in edges {
g.add_edge(src, tgt);
}
g
}
trait Processor {
fn run(&self);
}
trait Logger: Processor {
fn log(&self);
}
struct Result<T> {
value: T,
}
struct DataProcessor {
current: Result<DataProcessor>,
}
impl Processor for DataProcessor {
fn run(&self) {}
}
impl DataProcessor {
fn build(input: DataProcessor) -> Result<DataProcessor> {
Result { value: input }
}
}
enum GraphEvent {
NodeAdded(Graph),
Processed { proc: DataProcessor },
}
struct GraphPair(Graph, Result<DataProcessor>);