pub struct CelCompiler<'l> { /* private fields */ }Implementations§
Source§impl<'l> CelCompiler<'l>
impl<'l> CelCompiler<'l>
Sourcepub fn with_tokenizer(tokenizer: &'l mut dyn Tokenizer) -> Self
pub fn with_tokenizer(tokenizer: &'l mut dyn Tokenizer) -> Self
Examples found in repository?
examples/prog2json.rs (line 14)
5fn main() {
6 let args: Vec<String> = env::args().collect();
7
8 if args.len() != 2 {
9 eprintln!("Usage: prog2json <program>");
10 return;
11 }
12
13 let mut tokenizer = StringTokenizer::with_input(&args[1]);
14 let prog = CelCompiler::with_tokenizer(&mut tokenizer)
15 .compile()
16 .unwrap();
17
18 println!("{}", serde_json::to_string_pretty(&prog).unwrap());
19}Sourcepub fn compile(self) -> CelResult<Program>
pub fn compile(self) -> CelResult<Program>
Examples found in repository?
examples/prog2json.rs (line 15)
5fn main() {
6 let args: Vec<String> = env::args().collect();
7
8 if args.len() != 2 {
9 eprintln!("Usage: prog2json <program>");
10 return;
11 }
12
13 let mut tokenizer = StringTokenizer::with_input(&args[1]);
14 let prog = CelCompiler::with_tokenizer(&mut tokenizer)
15 .compile()
16 .unwrap();
17
18 println!("{}", serde_json::to_string_pretty(&prog).unwrap());
19}Auto Trait Implementations§
impl<'l> Freeze for CelCompiler<'l>
impl<'l> !RefUnwindSafe for CelCompiler<'l>
impl<'l> !Send for CelCompiler<'l>
impl<'l> !Sync for CelCompiler<'l>
impl<'l> Unpin for CelCompiler<'l>
impl<'l> !UnwindSafe for CelCompiler<'l>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more