[][src]Struct leo_compiler::compiler::Compiler

pub struct Compiler<F: Field + PrimeField, G: GroupType<F>> { /* fields omitted */ }

Implementations

impl<F: Field + PrimeField, G: GroupType<F>> Compiler<F, G>[src]

pub fn new(
    package_name: String,
    main_file_path: PathBuf,
    output_directory: PathBuf
) -> Self
[src]

pub fn parse_input(
    &mut self,
    input_string: &str,
    state_string: &str
) -> Result<(), CompilerError>
[src]

Parse the input and state files. Stores a typed ast of all input variables to the program.

pub fn parse_program_without_input(
    package_name: String,
    main_file_path: PathBuf,
    output_directory: PathBuf
) -> Result<Self, CompilerError>
[src]

Parses program files. Returns a compiler struct that stores the typed program abstract syntax trees (ast).

pub fn parse_program_with_input(
    package_name: String,
    main_file_path: PathBuf,
    output_directory: PathBuf,
    input_string: &str,
    state_string: &str
) -> Result<Self, CompilerError>
[src]

Parses input, state, and program files. Returns a compiler struct that stores the typed input and typed program abstract syntax trees (ast).

pub fn parse_program_from_string(
    &mut self,
    program_string: &str
) -> Result<(), CompilerError>
[src]

👎 Deprecated:

Please use the 'parse_program' method instead.

Parses the Leo program string, constructs a syntax tree, and generates a program. Used for testing only.

pub fn set_main_input(&mut self, input: MainInput)[src]

Manually sets main function input

pub fn verify_local_data_commitment(
    &self,
    system_parameters: &SystemParameters<Components>
) -> Result<bool, CompilerError>
[src]

Verifies the input to the program

pub fn checksum(&self) -> Result<String, CompilerError>[src]

pub fn compile_constraints<CS: ConstraintSystem<F>>(
    self,
    cs: &mut CS
) -> Result<OutputBytes, CompilerError>
[src]

Synthesizes the circuit without program input to verify correctness.

pub fn compile_test_constraints(
    self,
    input_pairs: InputPairs
) -> Result<(), CompilerError>
[src]

Synthesizes the circuit for test functions with program input.

pub fn generate_constraints_helper<CS: ConstraintSystem<F>>(
    self,
    cs: &mut CS
) -> Result<OutputBytes, CompilerError>
[src]

Calls the internal generate_constraints method with arguments

pub fn to_bytes(&self) -> Result<Vec<u8>, CompilerError>[src]

pub fn from_bytes(bytes: &[u8]) -> Result<Self, CompilerError>[src]

Trait Implementations

impl<F: Clone + Field + PrimeField, G: Clone + GroupType<F>> Clone for Compiler<F, G>[src]

impl<F: Field + PrimeField, G: GroupType<F>> ConstraintSynthesizer<F> for Compiler<F, G>[src]

fn generate_constraints<CS: ConstraintSystem<F>>(
    self,
    cs: &mut CS
) -> Result<(), SynthesisError>
[src]

Synthesizes the circuit with program input.

Auto Trait Implementations

impl<F, G> RefUnwindSafe for Compiler<F, G> where
    F: RefUnwindSafe,
    G: RefUnwindSafe

impl<F, G> Send for Compiler<F, G> where
    G: Send

impl<F, G> Sync for Compiler<F, G> where
    G: Sync

impl<F, G> Unpin for Compiler<F, G> where
    F: Unpin,
    G: Unpin

impl<F, G> UnwindSafe for Compiler<F, G> where
    F: UnwindSafe,
    G: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,