Skip to main content
pub struct FlushOptions 
    pub flush_interval: i32,
    pub flush_when_full: bool,

Options for controlling automatic flush behavior.

Fields

flush_interval: i32

Time interval in seconds for automatic periodic flush. Set to -1 (NO_PERIODIC_FLUSH) to disable automatic flush.

flush_when_full: bool

What the timed flush sends: if true (the default) only queues that have reached the batch size; if false, every buffered record regardless of queue fullness.

Only the timed flush reads this; BulkInserter::flush and BulkInserter::close always send everything. Because the insert paths already send a queue the moment it fills, a timed flush with true usually finds nothing to send. Use false if the timer should push partial batches out.

Implementations

Constant indicating no periodic flush (-1).

Source

pub const FLUSH_WHEN_FULL: bool = true

Default value for flush_when_full.

Source

pub fn new(flush_when_full: bool, flush_interval: i32) -> Self

Creates FlushOptions with specified values.

Whether the timed flush sends only queues that have reached the batch size.

Source

pub fn set_flush_when_full(&mut self, flush_when_full: bool)

Sets whether the timed flush sends only queues that have reached the batch size.

Source

pub fn flush_interval(&self) -> i32

The timed flush interval, in seconds.

Source

pub fn set_flush_interval(&mut self, flush_interval: i32)

Sets the timed flush interval, in seconds; the value is kept as given.

Trait Implementations

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source

fn fmt(&self, f: &mut Formatter<’_>) -> Result

Formats the value using the given formatter. Read more
Source

fn default() -> Self

No periodic flush, and a flush sends only full queues.

Source

fn eq(&self, other: &FlushOptions) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.