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 path_search;
18pub mod query;
19pub mod stack;
20pub mod syntax;
21pub(crate) mod utilities;
22
23pub use language::Language;
24
25#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
27#[allow(
28 clippy::exhaustive_structs,
29 reason = "a newtype id consumers build by literal; it never grows a field"
30)]
31pub struct NodeId(
32 pub u64,
34);
35
36#[derive(Clone, Copy, PartialEq, Eq, Debug)]
38#[allow(
39 clippy::exhaustive_structs,
40 reason = "a unit marker used by value; it has no fields to add"
41)]
42pub struct Ast;
43
44#[derive(Clone, Copy, PartialEq, Eq, Debug)]
46#[allow(
47 clippy::exhaustive_structs,
48 reason = "a unit marker used by value; it has no fields to add"
49)]
50pub struct Cfg;
51
52pub trait CodeGraph {
54 fn children(&self, n_id: NodeId) -> Vec<NodeId>;
56 fn parents(&self, n_id: NodeId) -> Vec<NodeId>;
58 fn ast_children(&self, n_id: NodeId) -> Vec<NodeId>;
60 fn ast_parents(&self, n_id: NodeId) -> Vec<NodeId>;
62 fn cfg_children(&self, n_id: NodeId) -> Vec<NodeId>;
64 fn cfg_parents(&self, n_id: NodeId) -> Vec<NodeId>;
66 fn label_type(&self, n_id: NodeId) -> Option<&str>;
68}