]> git.lizzy.rs Git - rust.git/blob - crates/ra_hir/src/lib.rs
move enum to code_model_api
[rust.git] / crates / ra_hir / src / lib.rs
1 //! HIR (previsouly known as descriptors) provides a high-level OO acess to Rust
2 //! code.
3 //!
4 //! The principal difference between HIR and syntax trees is that HIR is bound
5 //! to a particular crate instance. That is, it has cfg flags and features
6 //! applied. So, there relation between syntax and HIR is many-to-one.
7
8 macro_rules! ctry {
9     ($expr:expr) => {
10         match $expr {
11             None => return Ok(None),
12             Some(it) => it,
13         }
14     };
15 }
16
17 pub mod db;
18 #[cfg(test)]
19 mod mock;
20 mod query_definitions;
21 mod path;
22 pub mod source_binder;
23
24 mod ids;
25 mod macros;
26 mod name;
27 mod module_tree;
28 mod nameres;
29 mod function;
30 mod adt;
31 mod type_ref;
32 mod ty;
33 mod impl_block;
34 mod expr;
35
36 mod code_model_api;
37 mod code_model_impl;
38
39 use crate::{
40     db::HirDatabase,
41     name::{AsName, KnownName},
42     ids::{DefKind, SourceItemId, SourceFileItemId, SourceFileItems},
43 };
44
45 pub use self::{
46     path::{Path, PathKind},
47     name::Name,
48     ids::{HirFileId, DefId, DefLoc, MacroCallId, MacroCallLoc},
49     macros::{MacroDef, MacroInput, MacroExpansion},
50     module_tree::ModuleId,
51     nameres::{ItemMap, PerNs, Namespace, Resolution},
52     function::{Function, FnSignature, FnScopes, ScopesWithSyntaxMapping},
53     ty::Ty,
54     impl_block::{ImplBlock, ImplItem},
55 };
56
57 pub use self::function::FnSignatureInfo;
58
59 pub use self::code_model_api::{
60     Crate, CrateDependency,
61     Module, ModuleSource, Problem,
62     Struct, Enum,
63 };
64
65 pub enum Def {
66     Module(Module),
67     Function(Function),
68     Struct(Struct),
69     Enum(Enum),
70     Item,
71 }