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

# KineticaBytes

> KineticaBytes — Kinetica Rust API

[gpudb\_api](https://docs.kinetica.com/content/api/rust/index.md)::<wbr />[sqlx\_support](https://docs.kinetica.com/content/api/rust/sqlx_support/index.md)
[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sqlx_types.rs#L412)&#x20;

<pre>`pub struct KineticaBytes(pub Vec<u8>);`</pre>

Values for the Kinetica types SQLx’s own PostgreSQL types cannot read or write over Kinetica’s protocol, or cannot reliably: see their module. A `BLOB` column’s value. Kinetica refuses a `BYTEA` parameter, but takes the bytes of a text parameter as they are, so this sends them under the text type; it reads the `BYTEA` Kinetica sends.

Tuple Fields
`0: Vec<u8>`
Trait Implementations

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

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sqlx_types.rs#L411)
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/sqlx_types.rs#L430-L434)
impl\<'r> Decode\<'r, Postgres> for [KineticaBytes](https://docs.kinetica.com/content/api/rust/sqlx_support/struct.KineticaBytes.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sqlx_types.rs#L431-L433)
fn decode(value: PgValueRef\<'r>) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<Self, BoxDynError>

Decode a new value of this type using a raw value from the database.

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sqlx_types.rs#L411)
fn [default](https://doc.rust-lang.org/1.98.1/core/default/trait.Default.html#tymethod.default)() -> [KineticaBytes](https://docs.kinetica.com/content/api/rust/sqlx_support/struct.KineticaBytes.md)

Returns the “default value” for a type. [Read more](https://doc.rust-lang.org/1.98.1/core/default/trait.Default.html#tymethod.default)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sqlx_types.rs#L424-L428)
impl Encode\<'\_, Postgres> for [KineticaBytes](https://docs.kinetica.com/content/api/rust/sqlx_support/struct.KineticaBytes.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sqlx_types.rs#L425-L427)
fn encode\_by\_ref( \&self, buf: \&mut PgArgumentBuffer, ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<IsNull, BoxDynError>

Writes the value of `self` into `buf` without moving `self`. Read more

#### fn encode( self, buf: \&mut \<DB as Database>::ArgumentBuffer\<'q>, ) ->[Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<IsNull, [Box](https://doc.rust-lang.org/1.98.1/alloc/boxed/struct.Box.html)\<dyn [Error](https://doc.rust-lang.org/1.98.1/core/error/trait.Error.html) + [Send](https://doc.rust-lang.org/1.98.1/core/marker/trait.Send.html) + [Sync](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sync.html)>>&#xA;where Self: [Sized](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sized.html),

Writes the value of `self` into `buf` in the expected format for the database.

#### fn produces(\&self) -> [Option](https://doc.rust-lang.org/1.98.1/core/option/enum.Option.html)\<\<DB as Database>::TypeInfo>

#### fn size\_hint(\&self) -> [usize](https://doc.rust-lang.org/1.98.1/std/primitive.usize.html)

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

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sqlx_types.rs#L411)
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/sqlx_types.rs#L411)
impl [Ord](https://doc.rust-lang.org/1.98.1/core/cmp/trait.Ord.html) for [KineticaBytes](https://docs.kinetica.com/content/api/rust/sqlx_support/struct.KineticaBytes.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sqlx_types.rs#L411)
fn [cmp](https://doc.rust-lang.org/1.98.1/core/cmp/trait.Ord.html#tymethod.cmp)(\&self, other: &[KineticaBytes](https://docs.kinetica.com/content/api/rust/sqlx_support/struct.KineticaBytes.md)) -> [Ordering](https://doc.rust-lang.org/1.98.1/core/cmp/enum.Ordering.html)

This method returns an [`Ordering`](https://doc.rust-lang.org/1.98.1/core/cmp/enum.Ordering.html) between `self` and `other`. [Read more](https://doc.rust-lang.org/1.98.1/core/cmp/trait.Ord.html#tymethod.cmp)

1.21.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#1034-1036)

#### fn [max](https://doc.rust-lang.org/1.98.1/core/cmp/trait.Ord.html#method.max)(self, other: Self) -> Self&#xA;where Self: [Sized](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sized.html),

Compares and returns the maximum of two values. [Read more](https://doc.rust-lang.org/1.98.1/core/cmp/trait.Ord.html#method.max)

1.21.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#1073-1075)

#### fn [min](https://doc.rust-lang.org/1.98.1/core/cmp/trait.Ord.html#method.min)(self, other: Self) -> Self&#xA;where Self: [Sized](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sized.html),

Compares and returns the minimum of two values. [Read more](https://doc.rust-lang.org/1.98.1/core/cmp/trait.Ord.html#method.min)

1.50.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#1099-1101)

#### fn [clamp](https://doc.rust-lang.org/1.98.1/core/cmp/trait.Ord.html#method.clamp)(self, min: Self, max: Self) -> Self&#xA;where Self: [Sized](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sized.html),

Restrict a value to a certain interval. [Read more](https://doc.rust-lang.org/1.98.1/core/cmp/trait.Ord.html#method.clamp)

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

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sqlx_types.rs#L411)
fn [partial\_cmp](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp)(\&self, other: &[KineticaBytes](https://docs.kinetica.com/content/api/rust/sqlx_support/struct.KineticaBytes.md)) -> [Option](https://doc.rust-lang.org/1.98.1/core/option/enum.Option.html)\<[Ordering](https://doc.rust-lang.org/1.98.1/core/cmp/enum.Ordering.html)>

This method returns an ordering between `self` and `other` values if one exists. [Read more](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp)

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#1410)
fn [lt](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialOrd.html#method.lt)(\&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 less than (for `self` and `other`) and is used by the `<` operator. [Read more](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialOrd.html#method.lt)

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#1428)
fn [le](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialOrd.html#method.le)(\&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 less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialOrd.html#method.le)

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#1446)
fn [gt](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialOrd.html#method.gt)(\&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 greater than (for `self` and `other`) and is used by the `>` operator. [Read more](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialOrd.html#method.gt)

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#1464)
fn [ge](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialOrd.html#method.ge)(\&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 greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialOrd.html#method.ge)

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sqlx_types.rs#L414-L422)
impl Type\<Postgres> for [KineticaBytes](https://docs.kinetica.com/content/api/rust/sqlx_support/struct.KineticaBytes.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sqlx_types.rs#L415-L417)
fn type\_info() -> PgTypeInfo

Returns the canonical SQL type for this Rust type. Read more

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sqlx_types.rs#L419-L421)
fn compatible(ty: \&PgTypeInfo) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

Determines if this Rust type is compatible with the given SQL type. Read more


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