pub trait BufferData<T>: DerefMut<Target = [T]> {
// Required method
fn truncate(&mut self, len: usize);
}Expand description
Backing store of a binius_math::FieldBuffer that can be shrunk in place.
This lives here, rather than in binius-math, so that it can be a bound on
Allocator::Vec — that bound is what lets generic allocation code back a FieldBuffer with
an allocator’s buffer A::Vec<P> without threading a where A::Vec<P>: BufferData<P> clause
through every signature. FieldBuffer::truncate shrinks its backing store to match a smaller
log_len, so it is available only for the mutable backings that support that in place.
This trait is the shrinkable-store capability alone, and VecLike is that plus growth.
Three backings implement it:
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".