pub struct Parser<'a> { /* private fields */ }
Expand description
Parser.
Iteration
Box<Parser>
implements IntoIterator<Item = Result<Event, ParserError>>
,
and thus can be used in for
loops. The iterator is fused, and produces
None
forever after the end of stream or after a first encountered error.
Implementations
sourceimpl<'a> Parser<'a>
impl<'a> Parser<'a>
sourcepub fn new<R: Read + 'a>(reader: R) -> Result<Box<Self>, ParserError>
pub fn new<R: Read + 'a>(reader: R) -> Result<Box<Self>, ParserError>
Create a parser with default configuration.
If a custom configuration is needed, use ParserBuilder
to build a
Parser
instance.
sourcepub fn parse(&mut self) -> Result<Event, ParserError>
pub fn parse(&mut self) -> Result<Event, ParserError>
Parse an event.
sourcepub fn as_raw_ptr(&mut self) -> *mut yaml_parser_t
pub fn as_raw_ptr(&mut self) -> *mut yaml_parser_t
Return raw pointer to the underlying yaml_parser_t
.
Trait Implementations
sourceimpl<'a> IntoIterator for Box<Parser<'a>>
impl<'a> IntoIterator for Box<Parser<'a>>
type Item = <ParserIter<'a> as Iterator>::Item
type Item = <ParserIter<'a> as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = ParserIter<'a>
type IntoIter = ParserIter<'a>
Which kind of iterator are we turning this into?
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Parser<'a>
impl<'a> !Send for Parser<'a>
impl<'a> !Sync for Parser<'a>
impl<'a> Unpin for Parser<'a>
impl<'a> !UnwindSafe for Parser<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more