[−][src]Struct leo_compiler::compiler::Compiler
Stores information to compile a Leo program.
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]
package_name: String,
main_file_path: PathBuf,
output_directory: PathBuf
) -> Self
Returns a new Leo program compiler.
pub fn parse_program_without_input(
package_name: String,
main_file_path: PathBuf,
output_directory: PathBuf
) -> Result<Self, CompilerError>
[src]
package_name: String,
main_file_path: PathBuf,
output_directory: PathBuf
) -> Result<Self, CompilerError>
Returns a new Compiler
from the given main file path.
Parses and stores a program from the main file path. Parses and stores all imported programs. Performs type inference checking on the program and imported programs.
pub fn parse_program_with_input(
package_name: String,
main_file_path: PathBuf,
output_directory: PathBuf,
input_string: &str,
input_path: &Path,
state_string: &str,
state_path: &Path
) -> Result<Self, CompilerError>
[src]
package_name: String,
main_file_path: PathBuf,
output_directory: PathBuf,
input_string: &str,
input_path: &Path,
state_string: &str,
state_path: &Path
) -> Result<Self, CompilerError>
Returns a new Compiler
from the given main file path.
Parses and stores program input from from the input file path and state file path Parses and stores a program from the main file path. Parses and stores all imported programs. Performs type inference checking on the program, imported programs, and program input.
pub fn parse_input(
&mut self,
input_string: &str,
input_path: &Path,
state_string: &str,
state_path: &Path
) -> Result<(), CompilerError>
[src]
&mut self,
input_string: &str,
input_path: &Path,
state_string: &str,
state_path: &Path
) -> Result<(), CompilerError>
Parses and stores program input from from the input file path and state file path
Calls set_path()
on compiler errors with the given input file path or state file path
pub fn parse_program_from_string(
&mut self,
program_string: &str
) -> Result<(), CompilerError>
[src]
&mut self,
program_string: &str
) -> Result<(), CompilerError>
Please use the 'parse_program' method instead.
Equivalent to parse_and_check_program but uses the given program_string instead of a main file path.
Used for testing only.
pub fn set_main_input(&mut self, input: MainInput)
[src]
Manually sets main function input.
Used for testing only.
pub fn verify_local_data_commitment(
&self,
system_parameters: &SystemParameters<Components>
) -> Result<bool, CompilerError>
[src]
&self,
system_parameters: &SystemParameters<Components>
) -> Result<bool, CompilerError>
Verifies the input to the program.
pub fn checksum(&self) -> Result<String, CompilerError>
[src]
Returns a Sha256 checksum of the program file.
pub fn compile_constraints<CS: ConstraintSystem<F>>(
self,
cs: &mut CS
) -> Result<OutputBytes, CompilerError>
[src]
self,
cs: &mut CS
) -> Result<OutputBytes, CompilerError>
Synthesizes the circuit without program input to verify correctness.
pub fn compile_test_constraints(
self,
input_pairs: InputPairs
) -> Result<(u32, u32), CompilerError>
[src]
self,
input_pairs: InputPairs
) -> Result<(u32, u32), CompilerError>
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]
self,
cs: &mut CS
) -> Result<OutputBytes, CompilerError>
Calls the internal generate_constraints method with arguments.
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]
pub fn generate_constraints<CS: ConstraintSystem<F>>(
self,
cs: &mut CS
) -> Result<(), SynthesisError>
[src]
self,
cs: &mut CS
) -> Result<(), SynthesisError>
Synthesizes the circuit with program input.
Auto Trait Implementations
impl<F, G> RefUnwindSafe for Compiler<F, G> where
F: RefUnwindSafe,
G: RefUnwindSafe,
F: RefUnwindSafe,
G: RefUnwindSafe,
impl<F, G> Send for Compiler<F, G> where
G: Send,
G: Send,
impl<F, G> Sync for Compiler<F, G> where
G: Sync,
G: Sync,
impl<F, G> Unpin for Compiler<F, G> where
F: Unpin,
G: Unpin,
F: Unpin,
G: Unpin,
impl<F, G> UnwindSafe for Compiler<F, G> where
F: UnwindSafe,
G: UnwindSafe,
F: UnwindSafe,
G: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,