pub struct ProgramNode<T>where
T: ZkpType,{
pub ids: &'static [NodeIndex],
/* private fields */
}
Expand description
An implementation detail of the ZKP compiler. Each expression in a ZKP
program is expressed in terms of ProgramNode
, which proxy and compose
the parse graph for a ZKP program.
They proxy operations (+, -, /, etc) to their underlying type T to manipulate the program graph as appropriate.
§Remarks
For internal use only.
Fields§
§ids: &'static [NodeIndex]
The indices in the graph that compose the type backing this
ProgramNode
.
Implementations§
Trait Implementations§
Source§impl<T> Add for ProgramNode<T>
impl<T> Add for ProgramNode<T>
Source§impl<T> Clone for ProgramNode<T>
impl<T> Clone for ProgramNode<T>
Source§fn clone(&self) -> ProgramNode<T>
fn clone(&self) -> ProgramNode<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T> CreateZkpProgramInput for ProgramNode<T>where
T: ZkpType,
impl<T> CreateZkpProgramInput for ProgramNode<T>where
T: ZkpType,
Source§fn public_input() -> Self
fn public_input() -> Self
Creates a public program input of type T.
Source§fn private_input() -> Self
fn private_input() -> Self
Creates a private program input of type T.
Source§fn constant_input() -> Self
fn constant_input() -> Self
Creates a constant program input of type T.
Source§impl<T: ZkpType> Debug for ProgramNode<T>
impl<T: ZkpType> Debug for ProgramNode<T>
Source§impl<T> Div for ProgramNode<T>
impl<T> Div for ProgramNode<T>
Source§impl<T> IntoProgramNode for ProgramNode<T>where
T: ZkpType,
impl<T> IntoProgramNode for ProgramNode<T>where
T: ZkpType,
Source§type Output = T
type Output = T
The type of
ProgramNode
this becomes.Source§fn into_program_node(self) -> ProgramNode<Self::Output>
fn into_program_node(self) -> ProgramNode<Self::Output>
Turns the given value into a
ProgramNode
. Read moreSource§impl<T> Mul for ProgramNode<T>
impl<T> Mul for ProgramNode<T>
Source§impl<T> Neg for ProgramNode<T>
impl<T> Neg for ProgramNode<T>
Source§impl<T> Rem for ProgramNode<T>
impl<T> Rem for ProgramNode<T>
Source§impl<F: FieldSpec, const D: usize, const R: usize> Scale<F> for ProgramNode<RnsRingPolynomial<F, D, R>>
impl<F: FieldSpec, const D: usize, const R: usize> Scale<F> for ProgramNode<RnsRingPolynomial<F, D, R>>
Source§fn scale(self, x: ProgramNode<Field<F>>) -> Self
fn scale(self, x: ProgramNode<Field<F>>) -> Self
Return a structure scaled by
x
.Source§impl<T> Sub for ProgramNode<T>
impl<T> Sub for ProgramNode<T>
Source§impl<F: FieldSpec> ToBinary<F> for ProgramNode<Field<F>>
impl<F: FieldSpec> ToBinary<F> for ProgramNode<Field<F>>
Source§fn to_unsigned<const N: usize>(&self) -> [ProgramNode<Field<F>>; N]
fn to_unsigned<const N: usize>(&self) -> [ProgramNode<Field<F>>; N]
Decompose this value into unsigned N-bit binary. If the value
is too large, the proof will fail to validate.
Source§impl<F: FieldSpec, const N: usize, const R: usize> ToResidues<F, N, R> for ProgramNode<RnsRingPolynomial<F, N, R>>
impl<F: FieldSpec, const N: usize, const R: usize> ToResidues<F, N, R> for ProgramNode<RnsRingPolynomial<F, N, R>>
impl<T> Copy for ProgramNode<T>
Auto Trait Implementations§
impl<T> Freeze for ProgramNode<T>
impl<T> RefUnwindSafe for ProgramNode<T>where
T: RefUnwindSafe,
impl<T> Send for ProgramNode<T>where
T: Send,
impl<T> Sync for ProgramNode<T>where
T: Sync,
impl<T> Unpin for ProgramNode<T>where
T: Unpin,
impl<T> UnwindSafe for ProgramNode<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U, V> ConstrainCmp<T> for Uwhere
U: IntoProgramNode<Output = V>,
T: IntoProgramNode<Output = V>,
V: ZkpType + ConstrainCmpVarVar,
impl<T, U, V> ConstrainCmp<T> for Uwhere
U: IntoProgramNode<Output = V>,
T: IntoProgramNode<Output = V>,
V: ZkpType + ConstrainCmpVarVar,
Source§fn constrain_le_bounded(self, rhs: T, bits: usize)
fn constrain_le_bounded(self, rhs: T, bits: usize)
Constrain that this value is less than or equal to the RHS. Read more
Source§fn constrain_lt_bounded(self, rhs: T, bits: usize)
fn constrain_lt_bounded(self, rhs: T, bits: usize)
Constrain that this value is less than the RHS. Read more
Source§fn constrain_ge_bounded(self, rhs: T, bits: usize)
fn constrain_ge_bounded(self, rhs: T, bits: usize)
Constrain that this value is greater than or equal to the RHS. Read more
Source§fn constrain_gt_bounded(self, rhs: T, bits: usize)
fn constrain_gt_bounded(self, rhs: T, bits: usize)
Constrain that this value is greater than the RHS. Read more
Source§impl<T, U, V> ConstrainEq<T> for Uwhere
U: IntoProgramNode<Output = V>,
T: IntoProgramNode<Output = V>,
V: ZkpType + ConstrainEqVarVar,
impl<T, U, V> ConstrainEq<T> for Uwhere
U: IntoProgramNode<Output = V>,
T: IntoProgramNode<Output = V>,
V: ZkpType + ConstrainEqVarVar,
Source§fn constrain_eq(self, rhs: T) -> ProgramNode<<U as ConstrainEq<T>>::Output>
fn constrain_eq(self, rhs: T) -> ProgramNode<<U as ConstrainEq<T>>::Output>
Constrains this native field to equal the right hand side
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more