pub trait TriplesParser: Sized {
type Error: Error;
// Required methods
fn parse_step<E: From<Self::Error>>(
&mut self,
on_triple: &mut impl FnMut(Triple<'_>) -> Result<(), E>,
) -> Result<(), E>;
fn is_end(&self) -> bool;
// Provided methods
fn parse_all<E: From<Self::Error>>(
&mut self,
on_triple: &mut impl FnMut(Triple<'_>) -> Result<(), E>,
) -> Result<(), E> { ... }
fn into_iter<T, E: From<Self::Error>, F: FnMut(Triple<'_>) -> Result<T, E>>(
self,
convert_triple: F,
) -> TriplesParserIterator<T, E, F, Self> ⓘ { ... }
}
Expand description
A parser returning Triple
.
Required Associated Types§
Required Methods§
Sourcefn parse_step<E: From<Self::Error>>(
&mut self,
on_triple: &mut impl FnMut(Triple<'_>) -> Result<(), E>,
) -> Result<(), E>
fn parse_step<E: From<Self::Error>>( &mut self, on_triple: &mut impl FnMut(Triple<'_>) -> Result<(), E>, ) -> Result<(), E>
Parses a small chunk of the file and calls on_triple
each time a new triple is read.
(A “small chunk” could be a line for an N-Triples parser.)
This method should be called as long as is_end
returns false.
It may fail on errors caused by the parser itself or by the callback function on_triple
.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.