Skip to main content

Chunkable

Trait Chunkable 

Source
pub trait Chunkable<'a> {
    type Chunk: 'a;

    // Required method
    fn as_chunks(
        &'a self,
        chunk_size: usize,
    ) -> impl Iterator<Item = Self::Chunk>;
}
Expand description

Trait for chunking lists, for automatic chunked requests. This by design does not allocate, instead returning references into the original data.

Required Associated Types§

Source

type Chunk: 'a

The type of chunk produced. For example, a vector chunks into slices.

Required Methods§

Source

fn as_chunks(&'a self, chunk_size: usize) -> impl Iterator<Item = Self::Chunk>

Split the identity list into chunks of the given size.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Chunkable<'_> for i64

Source§

type Chunk = i64

Source§

fn as_chunks(&self, _chunk_size: usize) -> impl Iterator<Item = Self::Chunk>

Source§

impl<'a, T: 'a, const N: usize> Chunkable<'a> for &'a [T; N]

Source§

type Chunk = &'a [T]

Source§

fn as_chunks(&'a self, chunk_size: usize) -> impl Iterator<Item = Self::Chunk>

Source§

impl<'a, T: 'a> Chunkable<'a> for &'a Vec<T>

Source§

type Chunk = &'a [T]

Source§

fn as_chunks(&'a self, chunk_size: usize) -> impl Iterator<Item = Self::Chunk>

Source§

impl<'a, T: 'a> Chunkable<'a> for &'a [T]

Source§

type Chunk = &'a [T]

Source§

fn as_chunks(&'a self, chunk_size: usize) -> impl Iterator<Item = Self::Chunk>

Source§

impl<'a, T: 'a> Chunkable<'a> for Vec<T>

Source§

type Chunk = &'a [T]

Source§

fn as_chunks(&'a self, chunk_size: usize) -> impl Iterator<Item = Self::Chunk>

Source§

impl<'a> Chunkable<'a> for &'a String

Source§

type Chunk = &'a &'a String

Source§

fn as_chunks(&'a self, _chunk_size: usize) -> impl Iterator<Item = Self::Chunk>

Source§

impl<'a> Chunkable<'a> for &'a str

Source§

type Chunk = &'a &'a str

Source§

fn as_chunks(&'a self, _chunk_size: usize) -> impl Iterator<Item = Self::Chunk>

Implementors§

Source§

impl<'a, R> Chunkable<'a> for IdentityList<R>
where R: Chunkable<'a>,

Source§

impl<'a, R> Chunkable<'a> for IdentityOrInstanceList<R>
where R: Chunkable<'a>,

Source§

impl<'a> Chunkable<'a> for &'a CogniteExternalId

Source§

impl<'a> Chunkable<'a> for &'a CogniteId

Source§

type Chunk = &'a &'a CogniteId

Source§

impl<'a> Chunkable<'a> for &'a Identity

Source§

type Chunk = &'a &'a Identity

Source§

impl<'a> Chunkable<'a> for &'a IdentityOrInstance

Source§

impl<'a> Chunkable<'a> for &'a InstanceId

Source§

type Chunk = &'a &'a InstanceId