pub struct Alphas<F> { /* private fields */ }Expand description
This type can be used to create a mapping between powers of alpha and constraint types. See Self::default to create one, and Self::register to register a new mapping. Once you know the alpha value, you can convert this type to a Alphas.
Implementations§
Source§impl<F: Field> Alphas<F>
impl<F: Field> Alphas<F>
Sourcepub fn register(&mut self, ty: ArgumentType, powers: u32)
pub fn register(&mut self, ty: ArgumentType, powers: u32)
Registers a new ArgumentType,
associating it with a number powers of powers of alpha.
This function will panic if you register the same type twice.
Sourcepub fn get_exponents(
&self,
ty: ArgumentType,
num: u32,
) -> MustConsumeIterator<Range<u32>, u32> ⓘ
pub fn get_exponents( &self, ty: ArgumentType, num: u32, ) -> MustConsumeIterator<Range<u32>, u32> ⓘ
Returns a range of exponents, for a given ArgumentType, upperbounded by num.
Note that this function will panic if you did not register enough powers of alpha.
Sourcepub fn instantiate(&mut self, alpha: F)
pub fn instantiate(&mut self, alpha: F)
Instantiates the ranges with an actual field element alpha.
Once you call this function, you cannot register new constraints via Self::register.
Sourcepub fn get_alphas(
&self,
ty: ArgumentType,
num: u32,
) -> MustConsumeIterator<Cloned<Take<Skip<Iter<'_, F>>>>, F> ⓘ
pub fn get_alphas( &self, ty: ArgumentType, num: u32, ) -> MustConsumeIterator<Cloned<Take<Skip<Iter<'_, F>>>>, F> ⓘ
This function allows us to retrieve the powers of alpha, upperbounded by num
Trait Implementations§
Source§impl<'de, F> Deserialize<'de> for Alphas<F>where
F: Deserialize<'de>,
impl<'de, F> Deserialize<'de> for Alphas<F>where
F: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl<F> Freeze for Alphas<F>
impl<F> RefUnwindSafe for Alphas<F>where
F: RefUnwindSafe,
impl<F> Send for Alphas<F>where
F: Send,
impl<F> Sync for Alphas<F>where
F: Sync,
impl<F> Unpin for Alphas<F>where
F: Unpin,
impl<F> UnwindSafe for Alphas<F>where
F: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)