ligen-parser 0.1.18

Ligen (Language Interface Generator) is an extensible automatic binding generator ecosystem.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[derive(Debug)]
pub struct WithSource<T> {
    pub source: String,
    pub ast: T
}

impl<T> WithSource<T> {
    pub fn new(source: impl AsRef<str>, ast: T) -> Self {
        let source = source.as_ref().to_string();
        Self { source, ast }
    }

    pub fn sub<U>(&self, ast: U) -> WithSource<U> {
        WithSource::new(&self.source, ast)
    }
}