pub struct WriteOptions {
pub precision: Precision,
pub default_tags: HashMap<String, String>,
pub gzip_threshold: Option<usize>,
pub no_sync: bool,
pub accept_partial: bool,
pub use_v2_api: bool,
pub tag_order: Vec<String>,
pub batch_size: usize,
pub max_inflight: usize,
}Expand description
Options controlling a single write operation.
Defaults live in crate::ClientConfig::write_options; individual writes
override values via the crate::Client::write builder.
Fields§
§precision: PrecisionTimestamp precision for this write. Defaults to Nanosecond.
Tags merged into every point before serialisation. Point-level tags take precedence on collision.
gzip_threshold: Option<usize>If Some(n), compress the body with gzip when it exceeds n bytes.
Some(0) always compresses; None never compresses. Defaults to
Some(1024).
Compression trades CPU for bandwidth. The default suits remote/cloud
targets where bandwidth dominates. For high-throughput ingest over a
fast LAN (flight-test, IIoT), gzip CPU can become the bottleneck. Set
gzip_threshold(None) to disable it, or raise the threshold so only
large batches are compressed.
no_sync: boolWhen true, skip WAL synchronisation (faster, lower durability).
accept_partial: boolWhen true, a batch is accepted even if some lines are invalid.
use_v2_api: boolWhen true, use the v2 (/api/v2/write) endpoint instead of v3.
tag_order: Vec<String>Optional tag ordering for deterministic line-protocol output.
batch_size: usizeMaximum number of points per HTTP request when calling write.
Larger inputs are streamed as multiple sequential or pipelined requests.
Defaults to 5_000.
This is a point count, not a byte size. The effective ceiling is the
server’s maximum request size (configurable on InfluxDB, 10 MB by
default); if you raise batch_size into a 413, raise that limit too.
max_inflight: usizeMaximum number of concurrent in-flight HTTP requests when writing
multiple batches. Defaults to 4. Set to 1 for strict ordering.
Trait Implementations§
Source§impl Clone for WriteOptions
impl Clone for WriteOptions
Source§fn clone(&self) -> WriteOptions
fn clone(&self) -> WriteOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WriteOptions
impl Debug for WriteOptions
Auto Trait Implementations§
impl Freeze for WriteOptions
impl RefUnwindSafe for WriteOptions
impl Send for WriteOptions
impl Sync for WriteOptions
impl Unpin for WriteOptions
impl UnsafeUnpin for WriteOptions
impl UnwindSafe for WriteOptions
Blanket Implementations§
impl<T> Allocation for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request