#[repr(u8)]pub enum ValueSegment {
Constant = 0,
InOut = 1,
Private = 2,
Scratch = 3,
}Expand description
The section of the ValueVec a ValueIndex names.
The sections partition every word a circuit allocates. The first three hold the values a
ConstraintSystem may reference; Self::Scratch holds the
uncommitted temporaries that only exist while a circuit is evaluated.
The discriminants are the two-bit tag ValueIndex packs, and their order is the order the
sections occupy in the value vector.
Variants§
Constant = 0
The constants the circuit declares, known to both prover and verifier.
InOut = 1
The input/output values, which are public but chosen per instance.
Private = 2
The values only the prover knows: the declared witness and the values the gates create.
Scratch = 3
The uncommitted temporaries, live only while a circuit is evaluated.
These words are not committed and no constraint may reference them, so a
ValueIndex in this segment is meaningful only in the circuit’s wire mapping and its
evaluation form. ConstraintSystem::validate rejects
any operand term that names it.
Implementations§
Source§impl ValueSegment
impl ValueSegment
Sourcepub const ALL: [ValueSegment; 4]
pub const ALL: [ValueSegment; 4]
The four segments, in value-vector order.
Sourcepub const fn is_referenceable(self) -> bool
pub const fn is_referenceable(self) -> bool
Whether a ConstraintSystem operand may reference this segment.
Trait Implementations§
Source§impl Clone for ValueSegment
impl Clone for ValueSegment
Source§fn clone(&self) -> ValueSegment
fn clone(&self) -> ValueSegment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValueSegment
impl Debug for ValueSegment
Source§impl Hash for ValueSegment
impl Hash for ValueSegment
Source§impl Ord for ValueSegment
impl Ord for ValueSegment
Source§fn cmp(&self, other: &ValueSegment) -> Ordering
fn cmp(&self, other: &ValueSegment) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ValueSegment
impl PartialEq for ValueSegment
Source§fn eq(&self, other: &ValueSegment) -> bool
fn eq(&self, other: &ValueSegment) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ValueSegment
impl PartialOrd for ValueSegment
impl Copy for ValueSegment
impl Eq for ValueSegment
impl StructuralPartialEq for ValueSegment
Auto Trait Implementations§
impl Freeze for ValueSegment
impl RefUnwindSafe for ValueSegment
impl Send for ValueSegment
impl Sync for ValueSegment
impl Unpin for ValueSegment
impl UnsafeUnpin for ValueSegment
impl UnwindSafe for ValueSegment
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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