pub struct AsyncStreamingParser<R: AsyncBufRead + Unpin> { /* private fields */ }Available on crate feature
async-tokio only.Expand description
Async streaming parser for processing large files
Implementations§
Source§impl<R: AsyncRead + Unpin + Send> AsyncStreamingParser<BufReader<R>>
impl<R: AsyncRead + Unpin + Send> AsyncStreamingParser<BufReader<R>>
Sourcepub fn with_batch_size(reader: R, batch_size: usize) -> Self
pub fn with_batch_size(reader: R, batch_size: usize) -> Self
Create a streaming parser with a specific batch size
Source§impl<R: AsyncBufRead + Unpin> AsyncStreamingParser<R>
impl<R: AsyncBufRead + Unpin> AsyncStreamingParser<R>
Sourcepub fn from_buf_reader(reader: R, batch_size: usize) -> Self
pub fn from_buf_reader(reader: R, batch_size: usize) -> Self
Create from an existing async BufRead
Sourcepub fn triples_parsed(&self) -> usize
pub fn triples_parsed(&self) -> usize
Get the number of triples parsed so far
Sourcepub fn bytes_read(&self) -> usize
pub fn bytes_read(&self) -> usize
Get the number of bytes read so far
Sourcepub async fn next_batch_async(&mut self) -> TurtleResult<Option<Vec<Triple>>>
pub async fn next_batch_async(&mut self) -> TurtleResult<Option<Vec<Triple>>>
Parse the next batch of triples asynchronously
Sourcepub async fn stream_with_callback<F>(
&mut self,
callback: F,
) -> TurtleResult<usize>
pub async fn stream_with_callback<F>( &mut self, callback: F, ) -> TurtleResult<usize>
Stream all triples with a callback
Sourcepub async fn collect_all_async(&mut self) -> TurtleResult<Vec<Triple>>
pub async fn collect_all_async(&mut self) -> TurtleResult<Vec<Triple>>
Collect all triples into a vector
Auto Trait Implementations§
impl<R> Freeze for AsyncStreamingParser<R>where
R: Freeze,
impl<R> RefUnwindSafe for AsyncStreamingParser<R>where
R: RefUnwindSafe,
impl<R> Send for AsyncStreamingParser<R>where
R: Send,
impl<R> Sync for AsyncStreamingParser<R>where
R: Sync,
impl<R> Unpin for AsyncStreamingParser<R>
impl<R> UnsafeUnpin for AsyncStreamingParser<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for AsyncStreamingParser<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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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