Trait tidb_query_datatype::codec::data_type::ChunkedVec[][src]

pub trait ChunkedVec<T> {
    fn from_slice(slice: &[Option<T>]) -> Self;
fn from_vec(data: Vec<Option<T>>) -> Self;
fn push(&mut self, value: Option<T>);
fn is_empty(&self) -> bool;
fn with_capacity(capacity: usize) -> Self;
fn push_data(&mut self, value: T);
fn push_null(&mut self);
fn len(&self) -> usize;
fn truncate(&mut self, len: usize);
fn capacity(&self) -> usize;
fn append(&mut self, other: &mut Self);
fn to_vec(&self) -> Vec<Option<T>>; }

Notes

Make sure operating bitmap and value together, so while bitmap is 0 and the corresponding value is None.

With this guaranty, we can avoid the following issue:

For Data [Some(1), Some(2), None], we could have different stored representation:

Bitmap: 110, Value: 1, 2, 0 Bitmap: 110, Value: 1, 2, 1 Bitmap: 110, Value: 1, 2, 3

PartialEq between Value’s result could be wrong.

Required methods

fn from_slice(slice: &[Option<T>]) -> Self[src]

fn from_vec(data: Vec<Option<T>>) -> Self[src]

fn push(&mut self, value: Option<T>)[src]

fn is_empty(&self) -> bool[src]

fn with_capacity(capacity: usize) -> Self[src]

fn push_data(&mut self, value: T)[src]

fn push_null(&mut self)[src]

fn len(&self) -> usize[src]

fn truncate(&mut self, len: usize)[src]

fn capacity(&self) -> usize[src]

fn append(&mut self, other: &mut Self)[src]

fn to_vec(&self) -> Vec<Option<T>>[src]

Loading content...

Implementors

impl ChunkedVec<Enum> for ChunkedVecEnum[src]

impl ChunkedVec<Json> for ChunkedVecJson[src]

impl ChunkedVec<Set> for ChunkedVecSet[src]

impl ChunkedVec<Vec<u8, Global>> for ChunkedVecBytes[src]

impl<T: Clone> ChunkedVec<T> for ChunkedVecSized<T>[src]

Loading content...