pub struct Program<F: AcirField> {
pub functions: Vec<Circuit<F>>,
pub unconstrained_functions: Vec<BrilligBytecode<F>>,
}Expand description
A program represented by multiple ACIR circuit’s. The execution trace of these circuits is dictated by construction of the crate::native_types::WitnessStack.
Fields§
§functions: Vec<Circuit<F>>§unconstrained_functions: Vec<BrilligBytecode<F>>Implementations§
Source§impl<F: Serialize + AcirField> Program<F>
impl<F: Serialize + AcirField> Program<F>
Sourcefn write<W: Write>(&self, writer: W) -> Result<()>
fn write<W: Write>(&self, writer: W) -> Result<()>
Serialize and compress the Program into bytes.
pub fn serialize_program(program: &Self) -> Vec<u8>
Sourcepub fn serialize_program_base64<S>(
program: &Self,
s: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
pub fn serialize_program_base64<S>(
program: &Self,
s: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize and base64 encode program
Source§impl<F: AcirField + for<'a> Deserialize<'a>> Program<F>
impl<F: AcirField + for<'a> Deserialize<'a>> Program<F>
Sourcepub fn deserialize_program(serialized_circuit: &[u8]) -> Result<Self>
pub fn deserialize_program(serialized_circuit: &[u8]) -> Result<Self>
Deserialize bytecode.
Sourcepub fn deserialize_program_base64<'de, D>(
deserializer: D,
) -> Result<Self, D::Error>where
D: Deserializer<'de>,
pub fn deserialize_program_base64<'de, D>(
deserializer: D,
) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize and base64 decode program
Source§impl Program<FieldElement>
impl Program<FieldElement>
Sourcepub fn from_str(src: &str) -> Result<Self, AcirParserErrorWithSource>
pub fn from_str(src: &str) -> Result<Self, AcirParserErrorWithSource>
Creates a Program object from the given string.
pub fn from_str_impl(src: &str) -> Result<Self, AcirParserErrorWithSource>
Trait Implementations§
Source§impl<'de, F> Deserialize<'de> for Program<F>where
F: Deserialize<'de> + AcirField,
impl<'de, F> Deserialize<'de> for Program<F>where
F: Deserialize<'de> + AcirField,
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
Source§impl FromStr for Program<FieldElement>
impl FromStr for Program<FieldElement>
impl<F: Eq + AcirField> Eq for Program<F>
impl<F: AcirField> StructuralPartialEq for Program<F>
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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