Struct Encoder

Source
pub struct Encoder<'a, C: ColumnCursor>
where C::Item: 'a,
{ pub len: usize, pub state: C::State<'a>, pub writer: SlabWriter<'a, C::Item>, /* private fields */ }

Fields§

§len: usize§state: C::State<'a>§writer: SlabWriter<'a, C::Item>

Implementations§

Source§

impl<'a, C: ColumnCursor> Encoder<'a, C>
where C::Item: 'a,

Source

pub fn append<M: MaybePackable<'a, C::Item>>(&mut self, value: M) -> usize

Source

pub fn append_item(&mut self, value: Option<Cow<'a, C::Item>>) -> usize

Source

pub fn extend<I: Iterator<Item = Option<Cow<'a, C::Item>>>>(&mut self, iter: I)
where <C as ColumnCursor>::Item: 'a,

Source

pub fn append_bytes(&mut self, bytes: Option<Cow<'a, [u8]>>)

Source

pub fn new(locked: bool) -> Self

Source

pub fn with_capacity(_cap: usize, locked: bool) -> Self

Source

pub fn init(writer: SlabWriter<'a, C::Item>, state: C::State<'a>) -> Self

Source

pub fn copy( &mut self, slab: &'a [u8], range: Range<usize>, lit: usize, size: usize, acc: Acc, bool_state: Option<bool>, )

Source

pub fn flush(&mut self)

Source

pub fn finish(self) -> Vec<Slab>

Source

pub fn save_to(self, out: &mut Vec<u8>) -> Range<usize>

Source

pub fn save_to_unless_empty(self, out: &mut Vec<u8>) -> Range<usize>

Source

pub fn save_to_and_remap_unless_empty<'b, F>( self, out: &mut Vec<u8>, f: F, ) -> Range<usize>
where F: Fn(&C::Item) -> Option<&'b C::Item>, C::Item: 'b,

Source

pub fn into_column_data(self) -> ColumnData<C>

Source

pub fn copy_slab(&mut self, slab: &'a Slab)

Trait Implementations§

Source§

impl<C: ColumnCursor> Clone for Encoder<'_, C>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, C: Debug + ColumnCursor> Debug for Encoder<'a, C>
where C::Item: 'a + Debug, C::State<'a>: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<C: ColumnCursor> Default for Encoder<'_, C>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a, C> Freeze for Encoder<'a, C>
where <C as ColumnCursor>::State<'a>: Freeze,

§

impl<'a, C> RefUnwindSafe for Encoder<'a, C>

§

impl<'a, C> Send for Encoder<'a, C>
where <C as ColumnCursor>::State<'a>: Send, C: Send, <<C as ColumnCursor>::Item as ToOwned>::Owned: Send, <C as ColumnCursor>::Item: Sync,

§

impl<'a, C> Sync for Encoder<'a, C>
where <C as ColumnCursor>::State<'a>: Sync, C: Sync, <<C as ColumnCursor>::Item as ToOwned>::Owned: Sync, <C as ColumnCursor>::Item: Sync,

§

impl<'a, C> Unpin for Encoder<'a, C>
where <C as ColumnCursor>::State<'a>: Unpin, C: Unpin, <<C as ColumnCursor>::Item as ToOwned>::Owned: Unpin,

§

impl<'a, C> UnwindSafe for Encoder<'a, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.