pub trait WriteInput {
// Required method
fn into_lp_batches(
self,
opts: &WriteOptions,
) -> Box<dyn Iterator<Item = Result<Vec<u8>>> + Send>;
}Expand description
A type that can be lazily serialised to InfluxDB line protocol for writing.
Pass anything that implements this trait to crate::Client::write.
| Type | Use case |
|---|---|
&str / String | Pre-formatted line protocol (low-level escape hatch) |
Vec<Point> | Point builder API (pass ownership; clone a slice with .to_vec() if you must keep it) |
[crate::write_dataframe::DataFrameWrite] | polars DataFrame (polars feature) |
Implementations return an iterator that yields one batch per HTTP request. The iterator is consumed lazily, so only one batch buffer lives in memory at a time even for million-point writes.
Required Methods§
Sourcefn into_lp_batches(
self,
opts: &WriteOptions,
) -> Box<dyn Iterator<Item = Result<Vec<u8>>> + Send>
fn into_lp_batches( self, opts: &WriteOptions, ) -> Box<dyn Iterator<Item = Result<Vec<u8>>> + Send>
Lazily produce line-protocol batches, one per HTTP request.
Implementations should respect opts.batch_size. Errors per batch are
returned in the iterator so partially-valid inputs can still send what
they can.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".