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

# ByteBuf

> ByteBuf — Kinetica Rust API

[gpudb\_api](https://docs.kinetica.com/content/api/rust/index.md)
[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#46)&#x20;

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

Re-exported because generated request/response types expose Avro `bytes` fields as [`ByteBuf`](https://docs.kinetica.com/content/api/rust/struct.ByteBuf); callers would otherwise need their own `serde_bytes` dependency pinned to a matching version. Wrapper around `Vec<u8>` to serialize and deserialize efficiently.

```rust theme={null}
use std::collections::HashMap;
use std::io;

use serde_bytes::ByteBuf;

fn deserialize_bytebufs() -> Result<(), bincode::error::DecodeError> {
    let example_data = [2, 2, 3, 116, 119, 111, 1, 3, 111, 110, 101];

    let map: HashMap<u32, ByteBuf>;
    (map, _) = bincode::serde::decode_from_slice(
        &example_data,
        bincode::config::standard(),
    )?;

    println!("{:?}", map);

    Ok(())
}
```

## Implementations

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#50)
impl [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#52)
pub fn [new](#method.new)() -> [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

Construct a new, empty `ByteBuf`.

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#57)
pub fn [with\_capacity](#method.with_capacity)(cap: [usize](https://doc.rust-lang.org/1.98.1/std/primitive.usize.html)) -> [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

Construct a new, empty `ByteBuf` with the specified capacity.

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#62)

#### pub fn [from](#method.from)\<T>(bytes: T) ->[ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)&#xA;where T: [Into](https://doc.rust-lang.org/1.98.1/core/convert/trait.Into.html)\<[Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)>>,

Wrap existing bytes in a `ByteBuf`.

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#69)
pub fn [into\_vec](#method.into_vec)(self) -> [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)>&#x20;

Unwrap the vector of byte underlying this `ByteBuf`.

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#74)
pub fn [into\_boxed\_bytes](#method.into_boxed_bytes)(self) -> [Box](https://doc.rust-lang.org/1.98.1/alloc/boxed/struct.Box.html)\<[Bytes](https://docs.rs/serde_bytes/0.11.19/serde_bytes/bytes/struct.Bytes.html)>

## Trait Implementations

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#104)
impl [AsMut](https://doc.rust-lang.org/1.98.1/core/convert/trait.AsMut.html)\<\[[u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)]> for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#105)
fn [as\_mut](https://doc.rust-lang.org/1.98.1/core/convert/trait.AsMut.html#tymethod.as_mut)(\&mut self) -> \&mut \[[u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)]&#x20;

Converts this type into a mutable reference of the (usually inferred) input type.

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#98)
impl [AsRef](https://doc.rust-lang.org/1.98.1/core/convert/trait.AsRef.html)\<\[[u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)]> for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#99)
fn [as\_ref](https://doc.rust-lang.org/1.98.1/core/convert/trait.AsRef.html#tymethod.as_ref)(\&self) -> &\[[u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)]&#x20;

Converts this type into a shared reference of the (usually inferred) input type.

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#124)
impl [Borrow](https://doc.rust-lang.org/1.98.1/core/borrow/trait.Borrow.html)\<[Bytes](https://docs.rs/serde_bytes/0.11.19/serde_bytes/bytes/struct.Bytes.html)> for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#125)
fn [borrow](https://doc.rust-lang.org/1.98.1/core/borrow/trait.Borrow.html#tymethod.borrow)(\&self) -> &[Bytes](https://docs.rs/serde_bytes/0.11.19/serde_bytes/bytes/struct.Bytes.html)

Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/1.98.1/core/borrow/trait.Borrow.html#tymethod.borrow)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#130)
impl [BorrowMut](https://doc.rust-lang.org/1.98.1/core/borrow/trait.BorrowMut.html)\<[Bytes](https://docs.rs/serde_bytes/0.11.19/serde_bytes/bytes/struct.Bytes.html)> for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#131)
fn [borrow\_mut](https://doc.rust-lang.org/1.98.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut)(\&mut self) -> \&mut [Bytes](https://docs.rs/serde_bytes/0.11.19/serde_bytes/bytes/struct.Bytes.html)

Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/1.98.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#45)
impl [Clone](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html) for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#45)
fn [clone](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#tymethod.clone)(\&self) -> [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.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://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#92)
impl [Debug](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html) for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#93)
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/result/enum.Result.html)\<[()](https://doc.rust-lang.org/1.98.1/std/primitive.unit.html), [Error](https://doc.rust-lang.org/1.98.1/core/fmt/struct.Error.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://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#45)
impl [Default](https://doc.rust-lang.org/1.98.1/core/default/trait.Default.html) for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#45)
fn [default](https://doc.rust-lang.org/1.98.1/core/default/trait.Default.html#tymethod.default)() -> [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.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://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#110)
impl [Deref](https://doc.rust-lang.org/1.98.1/core/ops/deref/trait.Deref.html) for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#111)
type [Target](https://doc.rust-lang.org/1.98.1/core/ops/deref/trait.Deref.html#associatedtype.Target) = [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)>

The resulting type after dereferencing.

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#113)
fn [deref](https://doc.rust-lang.org/1.98.1/core/ops/deref/trait.Deref.html#tymethod.deref)(\&self) -> &\<[ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md) as [Deref](https://doc.rust-lang.org/1.98.1/core/ops/deref/trait.Deref.html)>::[Target](https://doc.rust-lang.org/1.98.1/core/ops/deref/trait.Deref.html#associatedtype.Target)

Dereferences the value.

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#118)
impl [DerefMut](https://doc.rust-lang.org/1.98.1/core/ops/deref/trait.DerefMut.html) for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#119)
fn [deref\_mut](https://doc.rust-lang.org/1.98.1/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut)(\&mut self) -> \&mut \<[ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md) as [Deref](https://doc.rust-lang.org/1.98.1/core/ops/deref/trait.Deref.html)>::[Target](https://doc.rust-lang.org/1.98.1/core/ops/deref/trait.Deref.html#associatedtype.Target)

Mutably dereferences the value.

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#254)
impl\<'de> [Deserialize](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.Deserialize.html)\<'de> for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#255-257)

#### fn [deserialize](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.Deserialize.html#tymethod.deserialize)\<D>( deserializer: D, ) ->[Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md), \<D as [Deserializer](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.Deserializer.html)\<'de>>::[Error](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.Deserializer.html#associatedtype.Error)>&#xA;where D: [Deserializer](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.Deserializer.html)\<'de>,

Deserialize this value from the given Serde deserializer. [Read more](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.Deserialize.html#tymethod.deserialize)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/de.rs.html#107)
impl\<'de> [Deserialize](https://docs.rs/serde_bytes/0.11.19/serde_bytes/de/trait.Deserialize.html)\<'de> for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)
Available on **crate features `alloc` or `std`** only.

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/de.rs.html#108-110)

#### fn [deserialize](https://docs.rs/serde_bytes/0.11.19/serde_bytes/de/trait.Deserialize.html#tymethod.deserialize)\<D>( deserializer: D, ) ->[Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md), \<D as [Deserializer](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.Deserializer.html)\<'de>>::[Error](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.Deserializer.html#associatedtype.Error)>&#xA;where D: [Deserializer](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.Deserializer.html)\<'de>,

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#45)
impl [Eq](https://doc.rust-lang.org/1.98.1/core/cmp/trait.Eq.html) for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#136)
impl [From](https://doc.rust-lang.org/1.98.1/core/convert/trait.From.html)\<[Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)>> for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#137)
fn [from](https://doc.rust-lang.org/1.98.1/core/convert/trait.From.html#tymethod.from)(bytes: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)>) -> [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

Converts to this type from the input type.

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#160)
impl [Hash](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hash.html) for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#161)

#### fn [hash](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hash.html#tymethod.hash)\<H>(\&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),

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://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#166)
impl [IntoIterator](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html) for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#167)
type [Item](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item) = [u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)

The type of the elements being iterated over.

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#168)
type [IntoIter](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter) = \<[Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)> as [IntoIterator](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html)>::[IntoIter](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter)

Which kind of iterator are we turning this into?

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#170)
fn [into\_iter](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter)(self) -> \<[ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md) as [IntoIterator](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html)>::[IntoIter](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter)

Creates an iterator from a value. [Read more](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#175)
impl\<'a> [IntoIterator](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html) for &'a [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#176)
type [Item](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item) = &'a [u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)

The type of the elements being iterated over.

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#177)
type [IntoIter](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter) = \<&'a \[[u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)] as [IntoIterator](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html)>::[IntoIter](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter)

Which kind of iterator are we turning this into?

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#179)
fn [into\_iter](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter)(self) -> \<&'a [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md) as [IntoIterator](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html)>::[IntoIter](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter)

Creates an iterator from a value. [Read more](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#184)
impl\<'a> [IntoIterator](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html) for &'a mut [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#185)
type [Item](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item) = &'a mut [u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)

The type of the elements being iterated over.

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#186)
type [IntoIter](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter) = \<&'a mut \[[u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)] as [IntoIterator](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html)>::[IntoIter](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter)

Which kind of iterator are we turning this into?

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#188)
fn [into\_iter](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter)(self) -> \<&'a mut [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md) as [IntoIterator](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html)>::[IntoIter](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter)

Creates an iterator from a value. [Read more](https://doc.rust-lang.org/1.98.1/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#45)
impl [Ord](https://doc.rust-lang.org/1.98.1/core/cmp/trait.Ord.html) for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#45)
fn [cmp](https://doc.rust-lang.org/1.98.1/core/cmp/trait.Ord.html#tymethod.cmp)(\&self, other: &[ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.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://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#142-144)

### impl\<Rhs>[PartialEq](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialEq.html)\<Rhs> for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)&#xA;where Rhs: [AsRef](https://doc.rust-lang.org/1.98.1/core/convert/trait.AsRef.html)\<\[[u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)]> + ?[Sized](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sized.html),

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#146)
fn [eq](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialEq.html#tymethod.eq)(\&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 `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://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#151-153)

### impl\<Rhs>[PartialOrd](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialOrd.html)\<Rhs> for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)&#xA;where Rhs: [AsRef](https://doc.rust-lang.org/1.98.1/core/convert/trait.AsRef.html)\<\[[u8](https://doc.rust-lang.org/1.98.1/std/primitive.u8.html)]> + ?[Sized](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sized.html),

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#155)
fn [partial\_cmp](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp)(\&self, other: [\&Rhs](https://doc.rust-lang.org/1.98.1/std/primitive.reference.html)) -> [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://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#193)
impl [Serialize](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serialize.html) for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/bytebuf.rs.html#194-196)

#### fn [serialize](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serialize.html#tymethod.serialize)\<S>( \&self, serializer: S, ) ->[Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<\<S as [Serializer](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serializer.html)>::[Ok](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serializer.html#associatedtype.Ok), \<S as [Serializer](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serializer.html)>::[Error](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serializer.html#associatedtype.Error)>&#xA;where S: [Serializer](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serializer.html),

Serialize this value into the given Serde serializer. [Read more](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serialize.html#tymethod.serialize)

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/ser.rs.html#73)
impl [Serialize](https://docs.rs/serde_bytes/0.11.19/serde_bytes/ser/trait.Serialize.html) for [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)
Available on **crate features `alloc` or `std`** only.

[Source](https://docs.rs/serde_bytes/0.11.19/src/serde_bytes/ser.rs.html#74-76)

#### fn [serialize](https://docs.rs/serde_bytes/0.11.19/serde_bytes/ser/trait.Serialize.html#tymethod.serialize)\<S>( \&self, serializer: S, ) ->[Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<\<S as [Serializer](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serializer.html)>::[Ok](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serializer.html#associatedtype.Ok), \<S as [Serializer](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serializer.html)>::[Error](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serializer.html#associatedtype.Error)>&#xA;where S: [Serializer](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serializer.html),


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