17 lines
446 B
Rust
17 lines
446 B
Rust
use prometeu_core::ProjectId;
|
|
use crate::ProjectDescriptor;
|
|
|
|
#[derive(Debug, Clone)]
|
|
pub struct ResolvedGraph {
|
|
pub root: ProjectId,
|
|
pub projects: Vec<ProjectDescriptor>, // arena
|
|
// opcional: adjacency list para checks
|
|
pub edges: Vec<Vec<ProjectId>>, // edges[from] = vec[to]
|
|
}
|
|
|
|
impl ResolvedGraph {
|
|
pub fn project(&self, id: &ProjectId) -> Option<&ProjectDescriptor> {
|
|
self.projects.get(id.0 as usize)
|
|
}
|
|
}
|