> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# FlushOptions

> FlushOptions — Kinetica Rust API

[gpudb\_api](https://docs.kinetica.com/content/api/rust/index.md)::<wbr />[bulk\_inserter](https://docs.kinetica.com/content/api/rust/bulk_inserter/index.md)
[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L388-L403)&#x20;

<pre>`pub struct FlushOptions {    pub flush_interval: i32,    pub flush_when_full: bool,}`</pre>

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`](https://docs.kinetica.com/content/api/rust/bulk_inserter/struct.BulkInserter#method.flush) and [`BulkInserter::close`](https://docs.kinetica.com/content/api/rust/bulk_inserter/struct.BulkInserter#method.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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L405-L441)
impl [FlushOptions](https://docs.kinetica.com/content/api/rust/bulk_inserter/struct.FlushOptions.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L407)
pub const [NO\_PERIODIC\_FLUSH](#associatedconstant.NO_PERIODIC_FLUSH): [i32](https://doc.rust-lang.org/1.98.1/std/primitive.i32.html) = -1

Constant indicating no periodic flush (-1).

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L410)
pub const [FLUSH\_WHEN\_FULL](#associatedconstant.FLUSH_WHEN_FULL): [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html) = true

Default value for flush\_when\_full.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L413-L418)
pub fn [new](#method.new)(flush\_when\_full: [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html), flush\_interval: [i32](https://doc.rust-lang.org/1.98.1/std/primitive.i32.html)) -> Self

Creates FlushOptions with specified values.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L422-L424)
pub fn [is\_flush\_when\_full](#method.is_flush_when_full)(\&self) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L428-L430)
pub fn [set\_flush\_when\_full](#method.set_flush_when_full)(\&mut self, flush\_when\_full: [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html))

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L433-L435)
pub fn [flush\_interval](#method.flush_interval)(\&self) -> [i32](https://doc.rust-lang.org/1.98.1/std/primitive.i32.html)

The timed flush interval, in seconds.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L438-L440)
pub fn [set\_flush\_interval](#method.set_flush_interval)(\&mut self, flush\_interval: [i32](https://doc.rust-lang.org/1.98.1/std/primitive.i32.html))

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

## Trait Implementations

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L387)
impl [Clone](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html) for [FlushOptions](https://docs.kinetica.com/content/api/rust/bulk_inserter/struct.FlushOptions.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L387)
fn [clone](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#tymethod.clone)(\&self) -> [FlushOptions](https://docs.kinetica.com/content/api/rust/bulk_inserter/struct.FlushOptions.md)

Returns a duplicate of the value. [Read more](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#tymethod.clone)

1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/142757)) · [Source](https://doc.rust-lang.org/1.98.1/src/core/clone.rs.html#245-247)
fn [clone\_from](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#method.clone_from)(\&mut self, source: \&Self)

Performs copy-assignment from `source`. [Read more](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#method.clone_from)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L387)
impl [Debug](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html) for [FlushOptions](https://docs.kinetica.com/content/api/rust/bulk_inserter/struct.FlushOptions.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L387)
fn [fmt](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html#tymethod.fmt)(\&self, f: \&mut [Formatter](https://doc.rust-lang.org/1.98.1/core/fmt/struct.Formatter.html)\<'\_>) -> [Result](https://doc.rust-lang.org/1.98.1/core/fmt/type.Result.html)

Formats the value using the given formatter. [Read more](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html#tymethod.fmt)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L443-L451)
impl [Default](https://doc.rust-lang.org/1.98.1/core/default/trait.Default.html) for [FlushOptions](https://docs.kinetica.com/content/api/rust/bulk_inserter/struct.FlushOptions.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L445-L450)
fn [default](https://doc.rust-lang.org/1.98.1/core/default/trait.Default.html#tymethod.default)() -> Self

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L387)
impl [Eq](https://doc.rust-lang.org/1.98.1/core/cmp/trait.Eq.html) for [FlushOptions](https://docs.kinetica.com/content/api/rust/bulk_inserter/struct.FlushOptions.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L387)
impl [PartialEq](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialEq.html) for [FlushOptions](https://docs.kinetica.com/content/api/rust/bulk_inserter/struct.FlushOptions.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L387)
fn [eq](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialEq.html#tymethod.eq)(\&self, other: &[FlushOptions](https://docs.kinetica.com/content/api/rust/bulk_inserter/struct.FlushOptions.md)) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

Tests for `self` and `other` values to be equal, and is used by `==`.

1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/143800)) · [Source](https://doc.rust-lang.org/1.98.1/src/core/cmp.rs.html#263)
fn [ne](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialEq.html#method.ne)(\&self, other: [\&Rhs](https://doc.rust-lang.org/1.98.1/std/primitive.reference.html)) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter.rs#L387)
impl [StructuralPartialEq](https://doc.rust-lang.org/1.98.1/core/marker/trait.StructuralPartialEq.html) for [FlushOptions](https://docs.kinetica.com/content/api/rust/bulk_inserter/struct.FlushOptions.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.