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

# ShardKeyValue

> ShardKeyValue — Kinetica Rust API

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

<pre>`pub enum ShardKeyValue<'a> {    Int(i32),    Long(i64),    Float(f32),    Double(f64),    String(&'a str),    Date(&'a str),    Ipv4(&'a str),    Decimal(&'a str),    Boolean(bool),    Int8(i8),    Int16(i16),    Timestamp(i64),    DateTime(&'a str),    Time(&'a str),    Uuid(&'a str),    Ulong(&'a str),    Null,}`</pre>

Typed shard key value to avoid string parsing overhead.Use typed variants when possible for better performance. String variants are provided for complex types that require parsing.

## Performance Notes

<ul>
  <li>Numeric types (`Int`, `Long`, `Float`, `Double`, `Boolean`, `Int8`, `Int16`) are `Copy` and zero-cost</li>
  <li>String references (`String`, `Date`, `Ipv4`, `Decimal`, etc.) are borrowed - no allocation</li>
  <li>All variants are `Copy` for zero-cost passing</li>
</ul>

## Variants

### Int([i32](https://doc.rust-lang.org/1.98.1/std/primitive.i32.html))

32-bit integer value

### Long([i64](https://doc.rust-lang.org/1.98.1/std/primitive.i64.html))

64-bit integer value

### Float([f32](https://doc.rust-lang.org/1.98.1/std/primitive.f32.html))

32-bit float value

### Double([f64](https://doc.rust-lang.org/1.98.1/std/primitive.f64.html))

64-bit double value

### String(&'a [str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html))

String value (also used for char(N) types) - borrowed reference

### Date(&'a [str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html))

Date in YYYY-MM-DD format - borrowed reference

### Ipv4(&'a [str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html))

IPv4 in dotted-quad format (e.g., “192.168.1.100”) - borrowed reference

### Decimal(&'a [str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html))

Decimal as string (e.g., “12345.6789”) - borrowed reference

### Boolean([bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html))

Boolean value (true/false)

### Int8([i8](https://doc.rust-lang.org/1.98.1/std/primitive.i8.html))

8-bit signed integer (-128 to 127)

### Int16([i16](https://doc.rust-lang.org/1.98.1/std/primitive.i16.html))

16-bit signed integer (-32768 to 32767)

### Timestamp([i64](https://doc.rust-lang.org/1.98.1/std/primitive.i64.html))

Timestamp as milliseconds since Unix epoch

### DateTime(&'a [str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html))

DateTime in YYYY-MM-DD HH:MM:SS.mmm format - borrowed reference

### Time(&'a [str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html))

Time in HH:MM:SS.mmm format - borrowed reference

### Uuid(&'a [str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html))

UUID in standard format (e.g., “550e8400-e29b-41d4-a716-446655440000”) - borrowed reference

### Ulong(&'a [str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html))

Unsigned long as string (0 to 18446744073709551615) - borrowed reference

### Null

A null value, for a column of any type. It encodes as zero bytes in the width of the column’s encoding.

## Trait Implementations

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter_common.rs#L38)
impl\<'a> [Clone](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html) for [ShardKeyValue](https://docs.kinetica.com/content/api/rust/bulk_inserter_common/enum.ShardKeyValue.md)\<'a>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter_common.rs#L38)
fn [clone](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#tymethod.clone)(\&self) -> [ShardKeyValue](https://docs.kinetica.com/content/api/rust/bulk_inserter_common/enum.ShardKeyValue.md)\<'a>

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_common.rs#L38)
impl\<'a> [Copy](https://doc.rust-lang.org/1.98.1/core/marker/trait.Copy.html) for [ShardKeyValue](https://docs.kinetica.com/content/api/rust/bulk_inserter_common/enum.ShardKeyValue.md)\<'a>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter_common.rs#L38)
impl\<'a> [Debug](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html) for [ShardKeyValue](https://docs.kinetica.com/content/api/rust/bulk_inserter_common/enum.ShardKeyValue.md)\<'a>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/bulk_inserter_common.rs#L38)
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)


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