rusty_bind_parser/parsing/
mod.rs1mod r#enum;
2mod exception_trait;
3mod module;
4mod rust_mod;
5mod traits_mod;
6
7use crate::utils::{BuildContext, NamesTracker};
8
9pub(crate) const EXTERN_EXCEPTION_TRAIT_MODULE_NAME: &str = "ExceptionTrait";
10pub(crate) const TRAITS_MODULE_NAME: &str = "Traits";
11pub(crate) const RUST_MODULE_NAME: &str = "Rust";
12
13pub struct Context {
14 build_context: BuildContext,
15 name_tracker: NamesTracker,
16}
17
18impl Context {
19 pub fn new(build_context: BuildContext, name_tracker: NamesTracker) -> Self {
20 Self {
21 build_context,
22 name_tracker,
23 }
24 }
25}
26
27pub trait Parser<T>
28where
29 Self: Sized,
30{
31 fn parse(data: &T, context: &mut Context) -> anyhow::Result<Self>;
32}