pub struct Program<F> {
pub step: u32,
pub pc_base: u32,
pub max_num_public_values: usize,
/* private fields */
}
Fields§
§step: u32
§pc_base: u32
§max_num_public_values: usize
The upper bound of the number of public values the program would publish. Currently, this won’t result any constraint. But users should always be aware of the limit of public values when they write programs.
Implementations§
Source§impl<F: Field> Program<F>
impl<F: Field> Program<F>
pub fn new_empty(step: u32, pc_base: u32, max_num_public_values: usize) -> Self
pub fn new_without_debug_infos( instructions: &[Instruction<F>], step: u32, pc_base: u32, max_num_public_values: usize, ) -> Self
Sourcepub fn from_instructions_and_debug_infos(
instructions: &[Instruction<F>],
debug_infos: &[Option<DebugInfo>],
) -> Self
pub fn from_instructions_and_debug_infos( instructions: &[Instruction<F>], debug_infos: &[Option<DebugInfo>], ) -> Self
We assume that pc_start = pc_base = 0 everywhere except the RISC-V programs, until we need otherwise We use DEFAULT_PC_STEP for consistency with RISC-V
pub fn strip_debug_infos(self) -> Self
pub fn from_instructions(instructions: &[Instruction<F>]) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn instructions(&self) -> Vec<Instruction<F>>
pub fn debug_infos(&self) -> Vec<Option<DebugInfo>>
pub fn enumerate_by_pc(&self) -> Vec<(u32, Instruction<F>, Option<DebugInfo>)>
pub fn get_instruction_and_debug_info( &self, index: usize, ) -> Option<(Instruction<F>, Option<DebugInfo>)>
pub fn push_instruction_and_debug_info( &mut self, instruction: Instruction<F>, debug_info: Option<DebugInfo>, )
pub fn push_instruction(&mut self, instruction: Instruction<F>)
pub fn append(&mut self, other: Program<F>)
Trait Implementations§
Source§impl<'de, F> Deserialize<'de> for Program<F>where
F: Deserialize<'de>,
impl<'de, F> Deserialize<'de> for Program<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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<F> Freeze for Program<F>
impl<F> RefUnwindSafe for Program<F>where
F: RefUnwindSafe,
impl<F> Send for Program<F>where
F: Send,
impl<F> Sync for Program<F>where
F: Sync,
impl<F> Unpin for Program<F>where
F: Unpin,
impl<F> UnwindSafe for Program<F>where
F: 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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