pub struct AnnotatedCsvParser<R: AsyncRead + Unpin> { /* private fields */ }Expand description
Async streaming parser for InfluxDB annotated CSV.
This parser reads an async byte stream and yields FluxRecords one at a time,
without loading the entire response into memory.
§Example
ⓘ
use influxdb_stream::parser::AnnotatedCsvParser;
use tokio::io::AsyncRead;
async fn parse<R: AsyncRead + Unpin + Send>(reader: R) {
let mut parser = AnnotatedCsvParser::new(reader);
while let Some(record) = parser.next().await.transpose() {
match record {
Ok(rec) => println!("Got record: {:?}", rec),
Err(e) => eprintln!("Parse error: {}", e),
}
}
}Implementations§
Auto Trait Implementations§
impl<R> Freeze for AnnotatedCsvParser<R>where
R: Freeze,
impl<R> RefUnwindSafe for AnnotatedCsvParser<R>where
R: RefUnwindSafe,
impl<R> Send for AnnotatedCsvParser<R>where
R: Send,
impl<R> Sync for AnnotatedCsvParser<R>where
R: Sync,
impl<R> Unpin for AnnotatedCsvParser<R>
impl<R> UnwindSafe for AnnotatedCsvParser<R>where
R: UnwindSafe,
Blanket Implementations§
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