> ## 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.

# JsonOptions

> JsonOptions — Kinetica Rust API

[gpudb\_api](https://docs.kinetica.com/content/api/rust/index.md)::<wbr />[json\_records](https://docs.kinetica.com/content/api/rust/json_records/index.md)
[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/json_records.rs#L22-L25)&#x20;

<pre>`pub struct JsonOptions { /* private fields */ }`</pre>

How records are sent as JSON.`compression_on` changes nothing: JSON requests are not compressed. `validate_json` has a JSON [`BulkInserter`](https://docs.kinetica.com/content/api/rust/bulk_inserter/struct.BulkInserter) check each record it is given; `insert_records_from_json` leaves the checking to the server.

## Implementations

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/json_records.rs#L41-L62)
impl [JsonOptions](https://docs.kinetica.com/content/api/rust/json_records/struct.JsonOptions.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/json_records.rs#L43)
pub const [VALIDATE\_JSON](#associatedconstant.VALIDATE_JSON): [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html) = false

Whether records are checked by default.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/json_records.rs#L46)
pub const [COMPRESSION\_ON](#associatedconstant.COMPRESSION_ON): [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html) = true

Whether compression is on by default.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/json_records.rs#L49-L51)
pub fn [new](#method.new)(validate\_json: [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html), compression\_on: [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)) -> Self

Options with validation and compression on or off as given.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/json_records.rs#L54-L56)
pub fn [is\_validate\_json](#method.is_validate_json)(\&self) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

Whether records are checked.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/json_records.rs#L59-L61)
pub fn [is\_compression\_on](#method.is_compression_on)(\&self) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

Whether compression is on.

## Trait Implementations

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/json_records.rs#L21)
fn [clone](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#tymethod.clone)(\&self) -> [JsonOptions](https://docs.kinetica.com/content/api/rust/json_records/struct.JsonOptions.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/json_records.rs#L21)
impl [Copy](https://doc.rust-lang.org/1.98.1/core/marker/trait.Copy.html) for [JsonOptions](https://docs.kinetica.com/content/api/rust/json_records/struct.JsonOptions.md)

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/json_records.rs#L21)
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/json_records.rs#L27-L32)
impl [Default](https://doc.rust-lang.org/1.98.1/core/default/trait.Default.html) for [JsonOptions](https://docs.kinetica.com/content/api/rust/json_records/struct.JsonOptions.md)

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

No validation, compression on.

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/json_records.rs#L36-L38)
fn [fmt](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Display.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)

`JsonOptions{validate_json=false, compression_on=true}`.

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/json_records.rs#L21)
impl [Hash](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hash.html) for [JsonOptions](https://docs.kinetica.com/content/api/rust/json_records/struct.JsonOptions.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/json_records.rs#L21)
fn [hash](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hash.html#tymethod.hash)\<\_\_H: [Hasher](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hasher.html)>(\&self, state: [\&mut \_\_H](https://doc.rust-lang.org/1.98.1/std/primitive.reference.html))

Feeds this value into the given [`Hasher`](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hasher.html). [Read more](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hash.html#tymethod.hash)

1.3.0 · [Source](https://doc.rust-lang.org/1.98.1/src/core/hash/mod.rs.html#234-236)

#### fn [hash\_slice](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hash.html#method.hash_slice)\<H>(data: &\[Self], state: [\&mut H](https://doc.rust-lang.org/1.98.1/std/primitive.reference.html))&#xA;where H: [Hasher](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hasher.html), Self: [Sized](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sized.html),

Feeds a slice of this type into the given [`Hasher`](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hasher.html). [Read more](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hash.html#method.hash_slice)

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/json_records.rs#L21)
fn [eq](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialEq.html#tymethod.eq)(\&self, other: &[JsonOptions](https://docs.kinetica.com/content/api/rust/json_records/struct.JsonOptions.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/json_records.rs#L21)
impl [StructuralPartialEq](https://doc.rust-lang.org/1.98.1/core/marker/trait.StructuralPartialEq.html) for [JsonOptions](https://docs.kinetica.com/content/api/rust/json_records/struct.JsonOptions.md)


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