pub trait VectorInstructions<F, T, const M: usize, const A: usize>{
// Required methods
fn resize<const L: usize>(
&self,
layouter: &mut impl Layouter<F>,
input: AssignedVector<F, T, M, A>,
) -> Result<AssignedVector<F, T, L, A>, Error>;
fn assign_with_filler(
&self,
layouter: &mut impl Layouter<F>,
value: Value<Vec<T::Element>>,
filler: Option<T::Element>,
) -> Result<AssignedVector<F, T, M, A>, Error>;
fn trim_beginning(
&self,
layouter: &mut impl Layouter<F>,
input: &AssignedVector<F, T, M, A>,
n_elems: usize,
) -> Result<AssignedVector<F, T, M, A>, Error>;
fn padding_flag(
&self,
layouter: &mut impl Layouter<F>,
input: &AssignedVector<F, T, M, A>,
) -> Result<(Box<[AssignedBit<F>; M]>, VectorBounds<F>), Error>;
fn get_limits(
&self,
layouter: &mut impl Layouter<F>,
input: &AssignedVector<F, T, M, A>,
) -> Result<VectorBounds<F>, Error>;
}Expand description
Instructions for Vector manipulation..
Required Methods§
Sourcefn resize<const L: usize>(
&self,
layouter: &mut impl Layouter<F>,
input: AssignedVector<F, T, M, A>,
) -> Result<AssignedVector<F, T, L, A>, Error>
fn resize<const L: usize>( &self, layouter: &mut impl Layouter<F>, input: AssignedVector<F, T, M, A>, ) -> Result<AssignedVector<F, T, L, A>, Error>
Sourcefn assign_with_filler(
&self,
layouter: &mut impl Layouter<F>,
value: Value<Vec<T::Element>>,
filler: Option<T::Element>,
) -> Result<AssignedVector<F, T, M, A>, Error>
fn assign_with_filler( &self, layouter: &mut impl Layouter<F>, value: Value<Vec<T::Element>>, filler: Option<T::Element>, ) -> Result<AssignedVector<F, T, M, A>, Error>
Sourcefn trim_beginning(
&self,
layouter: &mut impl Layouter<F>,
input: &AssignedVector<F, T, M, A>,
n_elems: usize,
) -> Result<AssignedVector<F, T, M, A>, Error>
fn trim_beginning( &self, layouter: &mut impl Layouter<F>, input: &AssignedVector<F, T, M, A>, n_elems: usize, ) -> Result<AssignedVector<F, T, M, A>, Error>
Trims n_elems elements from the beginning of the vector.
The trimmed elements will not be changed by filler elements,
they will remain in the buffer but not as part of the effective payload.
§Unsatisfiable Circuit
If the vector length < n_elems.
Sourcefn padding_flag(
&self,
layouter: &mut impl Layouter<F>,
input: &AssignedVector<F, T, M, A>,
) -> Result<(Box<[AssignedBit<F>; M]>, VectorBounds<F>), Error>
fn padding_flag( &self, layouter: &mut impl Layouter<F>, input: &AssignedVector<F, T, M, A>, ) -> Result<(Box<[AssignedBit<F>; M]>, VectorBounds<F>), Error>
Returns a vector of AssignedBits signaling the cells that represent padding with a 1, and the ones that represent payload data with a 0. Also returns the (start, end) limits of the data in the buffer, since they are computed internally.
Sourcefn get_limits(
&self,
layouter: &mut impl Layouter<F>,
input: &AssignedVector<F, T, M, A>,
) -> Result<VectorBounds<F>, Error>
fn get_limits( &self, layouter: &mut impl Layouter<F>, input: &AssignedVector<F, T, M, A>, ) -> Result<VectorBounds<F>, Error>
Returns the first and last positions of data in the buffer.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.