fluidattacks_blends_domain/
lib.rs1#![cfg_attr(not(test), no_std)]
8
9extern crate alloc;
10
11use alloc::vec::Vec;
12
13pub mod ast;
14pub mod content;
15pub mod graph_set;
16pub mod language;
17pub mod query;
18pub mod stack;
19pub mod syntax;
20pub(crate) mod utilities;
21
22pub use language::Language;
23
24#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
26#[allow(
27 clippy::exhaustive_structs,
28 reason = "a newtype id consumers build by literal; it never grows a field"
29)]
30pub struct NodeId(
31 pub u64,
33);
34
35#[derive(Clone, Copy, PartialEq, Eq, Debug)]
37#[allow(
38 clippy::exhaustive_structs,
39 reason = "a unit marker used by value; it has no fields to add"
40)]
41pub struct Ast;
42
43#[derive(Clone, Copy, PartialEq, Eq, Debug)]
45#[allow(
46 clippy::exhaustive_structs,
47 reason = "a unit marker used by value; it has no fields to add"
48)]
49pub struct Cfg;
50
51pub trait CodeGraph {
53 fn children(&self, n_id: NodeId) -> Vec<NodeId>;
55 fn parents(&self, n_id: NodeId) -> Vec<NodeId>;
57 fn ast_children(&self, n_id: NodeId) -> Vec<NodeId>;
59 fn ast_parents(&self, n_id: NodeId) -> Vec<NodeId>;
61 fn cfg_children(&self, n_id: NodeId) -> Vec<NodeId>;
63 fn cfg_parents(&self, n_id: NodeId) -> Vec<NodeId>;
65 fn label_type(&self, n_id: NodeId) -> Option<&str>;
67}