Skip to main content

xwrapup_parser/ds_node/
ds_context.rs

1use super::DsTreeRef;
2use xwrapup_derive::DsRef;
3
4#[derive(Debug, DsRef)]
5pub struct DsContext {
6    pub parent: Option<DsTreeRef>,
7    pub tree: DsTreeRef,
8}
9
10#[allow(dead_code)]
11impl DsContextRef {
12    pub fn new(parent: Option<DsTreeRef>, tree: DsTreeRef) -> Self {
13        DsContextRef {
14            inner: std::rc::Rc::new(std::cell::RefCell::new(DsContext { parent, tree })),
15        }
16    }
17}
18
19#[allow(dead_code)]
20impl DsContext {
21    pub fn new(parent: Option<DsTreeRef>, tree: DsTreeRef) -> Self {
22        DsContext { parent, tree }
23    }
24}