Struct rscel::StringTokenizer
source · pub struct StringTokenizer<'l> { /* private fields */ }Implementations§
source§impl<'l> StringTokenizer<'l>
impl<'l> StringTokenizer<'l>
sourcepub fn with_input(input: &'l str) -> StringTokenizer<'l>
pub fn with_input(input: &'l str) -> StringTokenizer<'l>
Examples found in repository?
examples/prog2json.rs (line 13)
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
fn main() {
let args: Vec<String> = env::args().collect();
if args.len() != 2 {
eprintln!("Usage: prog2json <program>");
return;
}
let mut tokenizer = StringTokenizer::with_input(&args[1]);
let prog = CelCompiler::with_tokenizer(&mut tokenizer)
.compile()
.unwrap();
println!("{}", serde_json::to_string_pretty(&prog).unwrap());
}Trait Implementations§
Auto Trait Implementations§
impl<'l> RefUnwindSafe for StringTokenizer<'l>
impl<'l> Send for StringTokenizer<'l>
impl<'l> Sync for StringTokenizer<'l>
impl<'l> Unpin for StringTokenizer<'l>
impl<'l> UnwindSafe for StringTokenizer<'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