pub struct Parser<T: Clone> { /* private fields */ }
Implementations§
Source§impl<T: Clone> Parser<T>
impl<T: Clone> Parser<T>
pub fn new(f: Rc<HandleLine<T>>) -> Self
pub fn parse<'a>(&mut self, data: &'a str) -> Lines<'a>
Sourcepub fn iter<'a>(&mut self, data: &'a str) -> TydIterator<'a, T> ⓘ
pub fn iter<'a>(&mut self, data: &'a str) -> TydIterator<'a, T> ⓘ
Examples found in repository?
examples/parse.rs (line 199)
184fn main() -> io::Result<()> {
185 //let s = ",}},}}},}";
186
187 //.inspect
188 //.find
189
190 //let count = rcount_ends_with(s, &["}", ",}", "},"]);
191 //println!("{:?} {}", count, s);
192
193 let raw = std::fs::read("examples/components")?;
194 let data = String::from_utf8_lossy(&raw);
195
196 let default_uses = String::new();
197
198 let mut parser = tyd::parser(&parse_line);
199 for (state, line) in parser.iter(&data) {
200 println!("{:?}", state)
201 }
202
203 Ok(())
204}
Auto Trait Implementations§
impl<T> Freeze for Parser<T>
impl<T> !RefUnwindSafe for Parser<T>
impl<T> !Send for Parser<T>
impl<T> !Sync for Parser<T>
impl<T> Unpin for Parser<T>
impl<T> !UnwindSafe for Parser<T>
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