pub trait ScalarLoader<F: PrimeField> {
type LoadedScalar: LoadedScalar<F, Loader = Self>;
Show 14 methods
// Required methods
fn load_const(&self, value: &F) -> Self::LoadedScalar;
fn assert_eq(
&self,
annotation: &str,
lhs: &Self::LoadedScalar,
rhs: &Self::LoadedScalar,
);
// Provided methods
fn load_zero(&self) -> Self::LoadedScalar { ... }
fn load_one(&self) -> Self::LoadedScalar { ... }
fn sum_with_coeff_and_const(
&self,
values: &[(F, &Self::LoadedScalar)],
constant: F,
) -> Self::LoadedScalar { ... }
fn sum_products_with_coeff_and_const(
&self,
values: &[(F, &Self::LoadedScalar, &Self::LoadedScalar)],
constant: F,
) -> Self::LoadedScalar { ... }
fn sum_with_coeff(
&self,
values: &[(F, &Self::LoadedScalar)],
) -> Self::LoadedScalar { ... }
fn sum_with_const(
&self,
values: &[&Self::LoadedScalar],
constant: F,
) -> Self::LoadedScalar { ... }
fn sum(&self, values: &[&Self::LoadedScalar]) -> Self::LoadedScalar { ... }
fn sum_products_with_coeff(
&self,
values: &[(F, &Self::LoadedScalar, &Self::LoadedScalar)],
) -> Self::LoadedScalar { ... }
fn sum_products_with_const(
&self,
values: &[(&Self::LoadedScalar, &Self::LoadedScalar)],
constant: F,
) -> Self::LoadedScalar { ... }
fn sum_products(
&self,
values: &[(&Self::LoadedScalar, &Self::LoadedScalar)],
) -> Self::LoadedScalar { ... }
fn product(&self, values: &[&Self::LoadedScalar]) -> Self::LoadedScalar { ... }
fn batch_invert<'a>(
values: impl IntoIterator<Item = &'a mut Self::LoadedScalar>,
)
where Self::LoadedScalar: 'a { ... }
}
Expand description
Field element loader.
Required Associated Types§
Sourcetype LoadedScalar: LoadedScalar<F, Loader = Self>
type LoadedScalar: LoadedScalar<F, Loader = Self>
Required Methods§
Sourcefn load_const(&self, value: &F) -> Self::LoadedScalar
fn load_const(&self, value: &F) -> Self::LoadedScalar
Load a constant field element.
Sourcefn assert_eq(
&self,
annotation: &str,
lhs: &Self::LoadedScalar,
rhs: &Self::LoadedScalar,
)
fn assert_eq( &self, annotation: &str, lhs: &Self::LoadedScalar, rhs: &Self::LoadedScalar, )
Assert lhs and rhs field elements are equal.
Provided Methods§
Sourcefn load_zero(&self) -> Self::LoadedScalar
fn load_zero(&self) -> Self::LoadedScalar
Load zero
as constant.
Sourcefn load_one(&self) -> Self::LoadedScalar
fn load_one(&self) -> Self::LoadedScalar
Load one
as constant.
Sourcefn sum_with_coeff_and_const(
&self,
values: &[(F, &Self::LoadedScalar)],
constant: F,
) -> Self::LoadedScalar
fn sum_with_coeff_and_const( &self, values: &[(F, &Self::LoadedScalar)], constant: F, ) -> Self::LoadedScalar
Sum field elements with coefficients and constant.
Sourcefn sum_products_with_coeff_and_const(
&self,
values: &[(F, &Self::LoadedScalar, &Self::LoadedScalar)],
constant: F,
) -> Self::LoadedScalar
fn sum_products_with_coeff_and_const( &self, values: &[(F, &Self::LoadedScalar, &Self::LoadedScalar)], constant: F, ) -> Self::LoadedScalar
Sum product of field elements with coefficients and constant.
Sourcefn sum_with_coeff(
&self,
values: &[(F, &Self::LoadedScalar)],
) -> Self::LoadedScalar
fn sum_with_coeff( &self, values: &[(F, &Self::LoadedScalar)], ) -> Self::LoadedScalar
Sum field elements with coefficients.
Sourcefn sum_with_const(
&self,
values: &[&Self::LoadedScalar],
constant: F,
) -> Self::LoadedScalar
fn sum_with_const( &self, values: &[&Self::LoadedScalar], constant: F, ) -> Self::LoadedScalar
Sum field elements and constant.
Sourcefn sum(&self, values: &[&Self::LoadedScalar]) -> Self::LoadedScalar
fn sum(&self, values: &[&Self::LoadedScalar]) -> Self::LoadedScalar
Sum field elements.
Sourcefn sum_products_with_coeff(
&self,
values: &[(F, &Self::LoadedScalar, &Self::LoadedScalar)],
) -> Self::LoadedScalar
fn sum_products_with_coeff( &self, values: &[(F, &Self::LoadedScalar, &Self::LoadedScalar)], ) -> Self::LoadedScalar
Sum product of field elements with coefficients.
Sourcefn sum_products_with_const(
&self,
values: &[(&Self::LoadedScalar, &Self::LoadedScalar)],
constant: F,
) -> Self::LoadedScalar
fn sum_products_with_const( &self, values: &[(&Self::LoadedScalar, &Self::LoadedScalar)], constant: F, ) -> Self::LoadedScalar
Sum product of field elements and constant.
Sourcefn sum_products(
&self,
values: &[(&Self::LoadedScalar, &Self::LoadedScalar)],
) -> Self::LoadedScalar
fn sum_products( &self, values: &[(&Self::LoadedScalar, &Self::LoadedScalar)], ) -> Self::LoadedScalar
Sum product of field elements.
Sourcefn product(&self, values: &[&Self::LoadedScalar]) -> Self::LoadedScalar
fn product(&self, values: &[&Self::LoadedScalar]) -> Self::LoadedScalar
Product of field elements.
Sourcefn batch_invert<'a>(
values: impl IntoIterator<Item = &'a mut Self::LoadedScalar>,
)where
Self::LoadedScalar: 'a,
fn batch_invert<'a>(
values: impl IntoIterator<Item = &'a mut Self::LoadedScalar>,
)where
Self::LoadedScalar: 'a,
Batch invert field elements.
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.