Skip to main content

AsyncParser

Trait AsyncParser 

Source
pub trait AsyncParser<Output> {
    // Required methods
    fn parse_async<R: AsyncRead + Unpin>(
        &self,
        reader: R,
    ) -> impl Future<Output = TurtleResult<Vec<Output>>> + Send;
    fn for_async_reader<R: AsyncBufRead + Unpin>(
        &self,
        reader: R,
    ) -> Box<dyn Stream<Item = TurtleResult<Output>> + Unpin>;
}
Available on crate feature async-tokio only.
Expand description

Async parser trait for Tokio integration

Required Methods§

Source

fn parse_async<R: AsyncRead + Unpin>( &self, reader: R, ) -> impl Future<Output = TurtleResult<Vec<Output>>> + Send

Parse from an async reader

Source

fn for_async_reader<R: AsyncBufRead + Unpin>( &self, reader: R, ) -> Box<dyn Stream<Item = TurtleResult<Output>> + Unpin>

Create an async stream for streaming parsing

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§