Skip to main content

BufferData

Trait BufferData 

Source
pub trait BufferData<T>: DerefMut<Target = [T]> {
    // Required method
    fn truncate(&mut self, len: usize);
}
Expand description

A mutable buffer of T that can be shrunk in place.

This is the backing store a binius_math::FieldBuffer needs in order to support FieldBuffer::truncate, which shrinks the store to match a smaller log_len.

This trait is the shrinkable-store capability alone, and VecLike is that plus growth. Three backings implement it:

  • Vec<T> and PoolVec both shrink and grow, so both are VecLike as well.
  • &mut [T] only shrinks, by re-slicing, which is what slice-backed sumcheck halves need.

Required Methods§

Source

fn truncate(&mut self, len: usize)

Shrinks the store in place to its first len elements.

len must be at most the current length.

Implementations on Foreign Types§

Source§

impl<T> BufferData<T> for &mut [T]

Source§

fn truncate(&mut self, len: usize)

Source§

impl<T> BufferData<T> for Vec<T>

Source§

fn truncate(&mut self, len: usize)

Implementors§