pub struct ParallelParser<R: Read> { /* private fields */ }parallel only.Expand description
Parallel parser for processing RDF files using multiple threads
Implementations§
Source§impl<R: Read + Send + Sync> ParallelParser<R>
impl<R: Read + Send + Sync> ParallelParser<R>
Sourcepub fn with_config(reader: R, config: ParallelConfig) -> Self
pub fn with_config(reader: R, config: ParallelConfig) -> Self
Create a parallel parser with custom configuration
Sourcepub fn parse_all(&mut self) -> TurtleResult<ParallelParseOutcome>
pub fn parse_all(&mut self) -> TurtleResult<ParallelParseOutcome>
Parse the entire document in parallel
This splits the document into chunks and parses them concurrently.
Chunks are cut on complete-statement boundaries (see
statement_boundary) rather than raw line boundaries, so a
statement that spans multiple lines (a pretty-printed predicate/object
list, or a triple-quoted string containing embedded newlines) is
always kept whole in a single chunk instead of being corrupted or
silently dropped at a chunk boundary.
@prefix/@base/PREFIX/BASE declarations are extracted (as
complete statements, so a rare multi-line prefix declaration is still
captured whole) and prepended to every data chunk so prefixed names
resolve correctly no matter which chunk the declaration appeared in.
In lenient mode, per-chunk parse errors are collected into the
returned ParallelParseOutcome::errors instead of being silently
printed to stderr.
Note: This loads the entire document into memory for splitting, since finding a statement boundary may require looking arbitrarily far ahead past a string literal.
Auto Trait Implementations§
impl<R> Freeze for ParallelParser<R>where
R: Freeze,
impl<R> RefUnwindSafe for ParallelParser<R>where
R: RefUnwindSafe,
impl<R> Send for ParallelParser<R>where
R: Send,
impl<R> Sync for ParallelParser<R>where
R: Sync,
impl<R> Unpin for ParallelParser<R>where
R: Unpin,
impl<R> UnsafeUnpin for ParallelParser<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for ParallelParser<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more