pub struct Location {
pub program: Option<Symbol>,
pub name: Symbol,
-}
Fields§
§program: Option<Symbol>
§name: Symbol
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Location
impl<'de> Deserialize<'de> for Location
source§fn deserialize<D>(deserializer: D) -> Result<Location, D::Error>where
+}Fields§
§program: Option<Symbol>
§name: Symbol
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Location
source§fn deserialize<D>(deserializer: D) -> Result<Location, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<&CompositeType> for Location
source§fn from(composite: &CompositeType) -> Location
Converts to this type from the input type.source§impl PartialEq for Location
source§impl Eq for Location
source§impl StructuralPartialEq for Location
Auto Trait Implementations§
§impl Freeze for Location
§impl RefUnwindSafe for Location
§impl Send for Location
§impl Sync for Location
§impl Unpin for Location
§impl UnwindSafe for Location
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_ast/expressions/enum.Literal.html b/leo_ast/expressions/enum.Literal.html
index 4f44b82c26..29fd37ea0e 100644
--- a/leo_ast/expressions/enum.Literal.html
+++ b/leo_ast/expressions/enum.Literal.html
@@ -21,7 +21,7 @@
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq for Literal
source§impl Eq for Literal
source§impl StructuralPartialEq for Literal
Auto Trait Implementations§
§impl Freeze for Literal
§impl RefUnwindSafe for Literal
§impl Send for Literal
§impl Sync for Literal
§impl Unpin for Literal
§impl UnwindSafe for Literal
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_ast/expressions/literal/enum.Literal.html b/leo_ast/expressions/literal/enum.Literal.html
index ccb6313ab5..ade94118ee 100644
--- a/leo_ast/expressions/literal/enum.Literal.html
+++ b/leo_ast/expressions/literal/enum.Literal.html
@@ -21,7 +21,7 @@
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
fn deserialize<D>(deserializer: D) -> Result<Location, D::Error>where
+}Fields§
§program: Option<Symbol>
§name: Symbol
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Location
source§fn deserialize<D>(deserializer: D) -> Result<Location, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<&CompositeType> for Location
source§fn from(composite: &CompositeType) -> Location
Converts to this type from the input type.source§impl PartialEq for Location
source§impl Eq for Location
source§impl StructuralPartialEq for Location
Auto Trait Implementations§
§impl Freeze for Location
§impl RefUnwindSafe for Location
§impl Send for Location
§impl Sync for Location
§impl Unpin for Location
§impl UnwindSafe for Location
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_ast/expressions/enum.Literal.html b/leo_ast/expressions/enum.Literal.html
index 4f44b82c26..29fd37ea0e 100644
--- a/leo_ast/expressions/enum.Literal.html
+++ b/leo_ast/expressions/enum.Literal.html
@@ -21,7 +21,7 @@
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq for Literal
source§impl Eq for Literal
source§impl StructuralPartialEq for Literal
Auto Trait Implementations§
§impl Freeze for Literal
§impl RefUnwindSafe for Literal
§impl Send for Literal
§impl Sync for Literal
§impl Unpin for Literal
§impl UnwindSafe for Literal
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_ast/expressions/literal/enum.Literal.html b/leo_ast/expressions/literal/enum.Literal.html
index ccb6313ab5..ade94118ee 100644
--- a/leo_ast/expressions/literal/enum.Literal.html
+++ b/leo_ast/expressions/literal/enum.Literal.html
@@ -21,7 +21,7 @@
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Fields§
§program: Option<Symbol>
§name: Symbol
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Location
impl<'de> Deserialize<'de> for Location
source§fn deserialize<D>(deserializer: D) -> Result<Location, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Location, D::Error>where
D: Deserializer<'de>,
source§impl From<&CompositeType> for Location
impl From<&CompositeType> for Location
source§fn from(composite: &CompositeType) -> Location
fn from(composite: &CompositeType) -> Location
source§impl PartialEq for Location
impl PartialEq for Location
impl Eq for Location
impl StructuralPartialEq for Location
Auto Trait Implementations§
impl Freeze for Location
impl RefUnwindSafe for Location
impl Send for Location
impl Sync for Location
impl Unpin for Location
impl UnwindSafe for Location
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_ast/expressions/enum.Literal.html b/leo_ast/expressions/enum.Literal.html
index 4f44b82c26..29fd37ea0e 100644
--- a/leo_ast/expressions/enum.Literal.html
+++ b/leo_ast/expressions/enum.Literal.html
@@ -21,7 +21,7 @@
__D: Deserializer<'de>,
impl<T> BorrowMut<T> for Twhere
diff --git a/leo_ast/expressions/enum.Literal.html b/leo_ast/expressions/enum.Literal.html
index 4f44b82c26..29fd37ea0e 100644
--- a/leo_ast/expressions/enum.Literal.html
+++ b/leo_ast/expressions/enum.Literal.html
@@ -21,7 +21,7 @@
__D: Deserializer<'de>,
source§impl PartialEq for Literal
impl PartialEq for Literal
impl Eq for Literal
impl StructuralPartialEq for Literal
impl Freeze for Literal
impl RefUnwindSafe for Literal
impl Send for Literal
impl Sync for Literal
impl Unpin for Literal
impl UnwindSafe for Literal
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_ast/expressions/literal/enum.Literal.html b/leo_ast/expressions/literal/enum.Literal.html
index ccb6313ab5..ade94118ee 100644
--- a/leo_ast/expressions/literal/enum.Literal.html
+++ b/leo_ast/expressions/literal/enum.Literal.html
@@ -21,7 +21,7 @@
__D: Deserializer<'de>,
impl<T> BorrowMut<T> for Twhere
diff --git a/leo_ast/expressions/literal/enum.Literal.html b/leo_ast/expressions/literal/enum.Literal.html
index ccb6313ab5..ade94118ee 100644
--- a/leo_ast/expressions/literal/enum.Literal.html
+++ b/leo_ast/expressions/literal/enum.Literal.html
@@ -21,7 +21,7 @@
__D: Deserializer<'de>,
source§impl PartialEq for Literal
impl PartialEq for Literal
impl Eq for Literal
impl StructuralPartialEq for Literal
Auto Trait Implementations§
impl Freeze for Literal
impl RefUnwindSafe for Literal
impl Send for Literal
impl Sync for Literal
impl Unpin for Literal
impl UnwindSafe for Literal
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_ast/struct.Ast.html b/leo_ast/struct.Ast.html
index 6659c84f3c..fc97a6e7f9 100644
--- a/leo_ast/struct.Ast.html
+++ b/leo_ast/struct.Ast.html
@@ -5,16 +5,16 @@
These data types form a tree that begins from a Program
type root.
impl<T> BorrowMut<T> for Twhere
diff --git a/leo_ast/struct.Ast.html b/leo_ast/struct.Ast.html
index 6659c84f3c..fc97a6e7f9 100644
--- a/leo_ast/struct.Ast.html
+++ b/leo_ast/struct.Ast.html
@@ -5,16 +5,16 @@
These data types form a tree that begins from a Program
type root.
Program
type root.
Fields§
§ast: Program
Implementations§
source§impl Ast
impl Ast
sourcepub fn as_repr(&self) -> &Program
pub fn as_repr(&self) -> &Program
Returns a reference to the inner program AST representation.
-pub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String>
pub fn to_json_string(&self) -> Result<String>
Serializes the ast into a JSON string.
-pub fn to_json_value(&self) -> Result<Value>
sourcepub fn to_json_file(&self, path: PathBuf, file_name: &str) -> Result<()>
pub fn to_json_file(&self, path: PathBuf, file_name: &str) -> Result<()>
Serializes the ast into a JSON file.
+pub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String>
pub fn to_json_string(&self) -> Result<String>
Serializes the ast into a JSON string.
+pub fn to_json_value(&self) -> Result<Value>
sourcepub fn to_json_file(&self, path: PathBuf, file_name: &str) -> Result<()>
pub fn to_json_file(&self, path: PathBuf, file_name: &str) -> Result<()>
Serializes the ast into a JSON file.
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<()>
pub fn to_json_file_without_keys( &self, path: PathBuf, file_name: &str, excluded_keys: &[&str] -) -> Result<()>
Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<Self>
pub fn from_json_string(json: &str) -> Result<Self>
Deserializes the JSON string into a ast.
-sourcepub fn from_json_file(path: PathBuf) -> Result<Self>
pub fn from_json_file(path: PathBuf) -> Result<Self>
Deserializes the JSON string into a ast from a file.
+) -> Result<()>Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<Self>
pub fn from_json_string(json: &str) -> Result<Self>
Deserializes the JSON string into a ast.
+sourcepub fn from_json_file(path: PathBuf) -> Result<Self>
pub fn from_json_file(path: PathBuf) -> Result<Self>
Deserializes the JSON string into a ast from a file.
Trait Implementations§
impl Eq for Ast
impl StructuralPartialEq for Ast
Auto Trait Implementations§
impl Freeze for Ast
impl !RefUnwindSafe for Ast
impl Send for Ast
impl !Sync for Ast
impl Unpin for Ast
impl UnwindSafe for Ast
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_ast/value/enum.Value.html b/leo_ast/value/enum.Value.html
index ac1e20e896..7564bd391f 100644
--- a/leo_ast/value/enum.Value.html
+++ b/leo_ast/value/enum.Value.html
@@ -17,10 +17,10 @@
U128(u128, Span),
Scalar(String, Span),
String(String, Span),
-}Variants§
§Input(Type, Identifier)
§Address(String, Span)
§Boolean(bool, Span)
§Struct(Identifier, IndexMap<Symbol, Value>)
§Field(String, Span)
§Group(Box<GroupLiteral>)
§I8(i8, Span)
§I16(i16, Span)
§I32(i32, Span)
§I64(i64, Span)
§I128(i128, Span)
§U8(u8, Span)
§U16(u16, Span)
§U32(u32, Span)
§U64(u64, Span)
§U128(u128, Span)
§Scalar(String, Span)
§String(String, Span)
Implementations§
source§impl Value
sourcepub(crate) fn abs(self, span: Span) -> Result<Self>
sourcepub(crate) fn abs_wrapped(self, span: Span) -> Result<Self>
sourcepub(crate) fn neg(self, span: Span) -> Result<Self>
sourcepub(crate) fn not(self, span: Span) -> Result<Self>
sourcepub(crate) fn add(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn add_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn bitand(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn div(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn div_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn eq(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn ge(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn gt(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn le(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn lt(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn mul(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn mul_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn bitor(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn pow(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn pow_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn shl(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn shl_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn shr(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn shr_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn sub(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn sub_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn xor(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn is_supported_const_fold_type(&self) -> bool
Trait Implementations§
source§impl PartialEq for Value
source§fn eq(&self, other: &Value) -> bool
This method tests for self
and other
values to be equal, and is used
+}Variants§
§Input(Type, Identifier)
§Address(String, Span)
§Boolean(bool, Span)
§Struct(Identifier, IndexMap<Symbol, Value>)
§Field(String, Span)
§Group(Box<GroupLiteral>)
§I8(i8, Span)
§I16(i16, Span)
§I32(i32, Span)
§I64(i64, Span)
§I128(i128, Span)
§U8(u8, Span)
§U16(u16, Span)
§U32(u32, Span)
§U64(u64, Span)
§U128(u128, Span)
§Scalar(String, Span)
§String(String, Span)
Implementations§
source§impl Value
sourcepub(crate) fn abs(self, span: Span) -> Result<Self>
sourcepub(crate) fn abs_wrapped(self, span: Span) -> Result<Self>
sourcepub(crate) fn neg(self, span: Span) -> Result<Self>
sourcepub(crate) fn not(self, span: Span) -> Result<Self>
sourcepub(crate) fn add(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn add_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn bitand(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn div(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn div_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn eq(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn ge(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn gt(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn le(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn lt(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn mul(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn mul_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn bitor(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn pow(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn pow_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn shl(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn shl_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn shr(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn shr_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn sub(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn sub_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn xor(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn is_supported_const_fold_type(&self) -> bool
Trait Implementations§
source§impl PartialEq for Value
source§impl Eq for Value
source§impl StructuralPartialEq for Value
Auto Trait Implementations§
§impl Freeze for Value
§impl RefUnwindSafe for Value
§impl Send for Value
§impl Sync for Value
§impl Unpin for Value
§impl UnwindSafe for Value
Blanket Implementations§
source§impl Eq for Value
source§impl StructuralPartialEq for Value
Auto Trait Implementations§
§impl Freeze for Value
§impl RefUnwindSafe for Value
§impl Send for Value
§impl Sync for Value
§impl Unpin for Value
§impl UnwindSafe for Value
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<Q, K> Equivalent<K> for Qwhere
diff --git a/leo_compiler/compiler/struct.Ast.html b/leo_compiler/compiler/struct.Ast.html
index db4a3519ca..ff245a2179 100644
--- a/leo_compiler/compiler/struct.Ast.html
+++ b/leo_compiler/compiler/struct.Ast.html
@@ -5,20 +5,20 @@
These data types form a tree that begins from a Program
type root.
Fields§
§ast: Program
Implementations§
source§impl Ast
sourcepub fn as_repr(&self) -> &Program
Returns a reference to the inner program AST representation.
-sourcepub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
+
sourcepub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
Serializes the ast into a JSON file.
+) -> Result<(), LeoError>Serializes the ast into a JSON file.
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<Ast, LeoError>
Deserializes the JSON string into a ast.
-sourcepub fn from_json_file(path: PathBuf) -> Result<Ast, LeoError>
Trait Implementations§
source§impl Eq for Ast
source§impl StructuralPartialEq for Ast
Auto Trait Implementations§
§impl Freeze for Ast
§impl !RefUnwindSafe for Ast
§impl Send for Ast
§impl !Sync for Ast
§impl Unpin for Ast
§impl UnwindSafe for Ast
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_compiler/compiler/struct.Compiler.html b/leo_compiler/compiler/struct.Compiler.html
index 3d7910794c..fc6adb7839 100644
--- a/leo_compiler/compiler/struct.Compiler.html
+++ b/leo_compiler/compiler/struct.Compiler.html
@@ -1,5 +1,5 @@
Compiler in leo_compiler::compiler - Rust Struct leo_compiler::compiler::Compiler
source · pub struct Compiler<'a, N: Network> {
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
pub program_name: String,
@@ -9,10 +9,10 @@
node_builder: NodeBuilder,
assigner: Assigner,
type_table: TypeTable,
- import_stubs: IndexMap<Symbol, Stub>,
+ import_stubs: IndexMap<Symbol, Stub>,
phantom: PhantomData<N>,
}
Expand description
The primary entry point of the Leo compiler.
-Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
+Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
§main_file_path: PathBuf
The path to the main leo file.
§output_directory: PathBuf
The path to where the compiler outputs all generated files.
§program_name: String
The program name,
@@ -22,57 +22,57 @@
§node_builder: NodeBuilder
The NodeCounter
used to generate sequentially increasing NodeID
s.
§assigner: Assigner
The Assigner
is used to construct (unique) assignment statements.
§type_table: TypeTable
The type table.
-§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
+§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
§phantom: PhantomData<N>
Implementations§
source§impl<'a, N: Network> Compiler<'a, N>
sourcepub fn new(
program_name: String,
network: String,
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
compiler_options: Option<CompilerOptions>,
- import_stubs: IndexMap<Symbol, Stub>
+ import_stubs: IndexMap<Symbol, Stub>
) -> Self
Returns a new Leo compiler.
-sourcepub fn parse_program_from_string(
&mut self,
program_string: &str,
- name: FileName
-) -> Result<()>
Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
-sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
-sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
+ name: FileName
+) -> Result<()>Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
+sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
+sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
sourcepub fn type_checker_pass(
&'a self,
symbol_table: SymbolTable
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the type checker pass.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the type checker pass.
sourcepub fn loop_unrolling_pass(
&mut self,
symbol_table: SymbolTable
-) -> Result<SymbolTable>
Runs the loop unrolling pass.
+) -> Result<SymbolTable>Runs the loop unrolling pass.
sourcepub fn static_single_assignment_pass(
&mut self,
symbol_table: &SymbolTable
-) -> Result<()>
Runs the static single assignment pass.
-sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
-sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
-sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
-sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
+) -> Result<()>Runs the static single assignment pass.
+sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
+sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
+sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
+sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
sourcepub fn code_generation_pass(
&mut self,
symbol_table: &SymbolTable,
struct_graph: &StructGraph,
call_graph: &CallGraph
-) -> Result<String>
Runs the code generation pass.
+) -> Result<String>Runs the code generation pass.
sourcepub fn compiler_stages(
&mut self
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the compiler stages.
-sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the compiler stages.
+sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
sourcefn write_symbol_table_to_json(
&self,
file_suffix: &str,
symbol_table: &SymbolTable
-) -> Result<()>
Writes the Symbol Table to a JSON file.
-sourcepub fn add_import_stubs(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
§impl<'a, N> !Freeze for Compiler<'a, N>
§impl<'a, N> !RefUnwindSafe for Compiler<'a, N>
§impl<'a, N> !Send for Compiler<'a, N>
§impl<'a, N> !Sync for Compiler<'a, N>
§impl<'a, N> Unpin for Compiler<'a, N>where
N: Unpin,
§impl<'a, N> !UnwindSafe for Compiler<'a, N>
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_compiler/compiler/struct.SymbolTable.html b/leo_compiler/compiler/struct.SymbolTable.html
index dc00879288..7e990f1dc1 100644
--- a/leo_compiler/compiler/struct.SymbolTable.html
+++ b/leo_compiler/compiler/struct.SymbolTable.html
@@ -13,8 +13,8 @@
&self,
location: &Location,
is_struct: bool,
- span: Span
-) -> Result<(), LeoError>Recursively checks if the symbol table contains an entry for the given symbol.
+ span: Span
+) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol.
Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
Returns the current scope index.
Increments the scope index.
@@ -22,35 +22,35 @@
&mut self,
location: Location,
insert: &Function
-) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
-sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SymbolTable
source§impl Default for SymbolTable
source§fn default() -> SymbolTable
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_compiler/struct.Ast.html b/leo_compiler/struct.Ast.html
index ad68be994a..1e6b1d6afa 100644
--- a/leo_compiler/struct.Ast.html
+++ b/leo_compiler/struct.Ast.html
@@ -5,20 +5,20 @@
These data types form a tree that begins from a Program
type root.
Fields§
§ast: Program
Implementations§
source§impl Ast
sourcepub fn as_repr(&self) -> &Program
Returns a reference to the inner program AST representation.
-sourcepub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
+
sourcepub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
Serializes the ast into a JSON file.
+) -> Result<(), LeoError>Serializes the ast into a JSON file.
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<Ast, LeoError>
Deserializes the JSON string into a ast.
-sourcepub fn from_json_file(path: PathBuf) -> Result<Ast, LeoError>
Trait Implementations§
source§impl Eq for Ast
source§impl StructuralPartialEq for Ast
Auto Trait Implementations§
§impl Freeze for Ast
§impl !RefUnwindSafe for Ast
§impl Send for Ast
§impl !Sync for Ast
§impl Unpin for Ast
§impl UnwindSafe for Ast
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_compiler/struct.Compiler.html b/leo_compiler/struct.Compiler.html
index 3b92156fca..753a369be0 100644
--- a/leo_compiler/struct.Compiler.html
+++ b/leo_compiler/struct.Compiler.html
@@ -1,5 +1,5 @@
Compiler in leo_compiler - Rust Struct leo_compiler::Compiler
source · pub struct Compiler<'a, N: Network> {
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
pub program_name: String,
@@ -9,10 +9,10 @@
node_builder: NodeBuilder,
assigner: Assigner,
type_table: TypeTable,
- import_stubs: IndexMap<Symbol, Stub>,
+ import_stubs: IndexMap<Symbol, Stub>,
phantom: PhantomData<N>,
}
Expand description
The primary entry point of the Leo compiler.
-Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
+Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
§main_file_path: PathBuf
The path to the main leo file.
§output_directory: PathBuf
The path to where the compiler outputs all generated files.
§program_name: String
The program name,
@@ -22,57 +22,57 @@
§node_builder: NodeBuilder
The NodeCounter
used to generate sequentially increasing NodeID
s.
§assigner: Assigner
The Assigner
is used to construct (unique) assignment statements.
§type_table: TypeTable
The type table.
-§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
+§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
§phantom: PhantomData<N>
Implementations§
source§impl<'a, N: Network> Compiler<'a, N>
sourcepub fn new(
program_name: String,
network: String,
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
compiler_options: Option<CompilerOptions>,
- import_stubs: IndexMap<Symbol, Stub>
+ import_stubs: IndexMap<Symbol, Stub>
) -> Self
Returns a new Leo compiler.
-sourcepub fn parse_program_from_string(
&mut self,
program_string: &str,
- name: FileName
-) -> Result<()>
Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
-sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
-sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
+ name: FileName
+) -> Result<()>Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
+sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
+sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
sourcepub fn type_checker_pass(
&'a self,
symbol_table: SymbolTable
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the type checker pass.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the type checker pass.
sourcepub fn loop_unrolling_pass(
&mut self,
symbol_table: SymbolTable
-) -> Result<SymbolTable>
Runs the loop unrolling pass.
+) -> Result<SymbolTable>Runs the loop unrolling pass.
sourcepub fn static_single_assignment_pass(
&mut self,
symbol_table: &SymbolTable
-) -> Result<()>
Runs the static single assignment pass.
-sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
-sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
-sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
-sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
+) -> Result<()>Runs the static single assignment pass.
+sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
+sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
+sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
+sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
sourcepub fn code_generation_pass(
&mut self,
symbol_table: &SymbolTable,
struct_graph: &StructGraph,
call_graph: &CallGraph
-) -> Result<String>
Runs the code generation pass.
+) -> Result<String>Runs the code generation pass.
sourcepub fn compiler_stages(
&mut self
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the compiler stages.
-sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the compiler stages.
+sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
sourcefn write_symbol_table_to_json(
&self,
file_suffix: &str,
symbol_table: &SymbolTable
-) -> Result<()>
Writes the Symbol Table to a JSON file.
-sourcepub fn add_import_stubs(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
§impl<'a, N> !Freeze for Compiler<'a, N>
§impl<'a, N> !RefUnwindSafe for Compiler<'a, N>
§impl<'a, N> !Send for Compiler<'a, N>
§impl<'a, N> !Sync for Compiler<'a, N>
§impl<'a, N> Unpin for Compiler<'a, N>where
N: Unpin,
§impl<'a, N> !UnwindSafe for Compiler<'a, N>
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_compiler/struct.SymbolTable.html b/leo_compiler/struct.SymbolTable.html
index abd12cc7c0..cf23f3f321 100644
--- a/leo_compiler/struct.SymbolTable.html
+++ b/leo_compiler/struct.SymbolTable.html
@@ -13,8 +13,8 @@
&self,
location: &Location,
is_struct: bool,
- span: Span
-) -> Result<(), LeoError>Recursively checks if the symbol table contains an entry for the given symbol.
+ span: Span
+) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol.
Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
Returns the current scope index.
Increments the scope index.
@@ -22,35 +22,35 @@
&mut self,
location: Location,
insert: &Function
-) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
-sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SymbolTable
source§impl Default for SymbolTable
source§fn default() -> SymbolTable
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_disassembler/fn.disassemble_from_str.html b/leo_disassembler/fn.disassemble_from_str.html
index 0dc23c5ffd..73dd2bcdf6 100644
--- a/leo_disassembler/fn.disassemble_from_str.html
+++ b/leo_disassembler/fn.disassemble_from_str.html
@@ -1,4 +1,4 @@
disassemble_from_str in leo_disassembler - Rust Function leo_disassembler::disassemble_from_str
source · pub fn disassemble_from_str<N: Network>(
name: &str,
program: &str
-) -> Result<Stub, UtilError>
\ No newline at end of file
+) -> Result<Stub, UtilError>
\ No newline at end of file
diff --git a/leo_errors/common/index.html b/leo_errors/common/index.html
index 9823564797..7349584cbe 100644
--- a/leo_errors/common/index.html
+++ b/leo_errors/common/index.html
@@ -1,2 +1,2 @@
-leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors..
+leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors.
Re-exports§
pub use self::backtraced::*;
pub use self::formatted::*;
pub use self::traits::*;
Modules§
- This module contains a backtraced error and its methods.
- This module contains a formatted error and its methods.
- This module contains the macros for making errors easily.
- This module contains traits for making errors easily.
\ No newline at end of file
diff --git a/leo_errors/errors/enum.LeoError.html b/leo_errors/errors/enum.LeoError.html
index 14a74cc5b9..8ec7a32fc3 100644
--- a/leo_errors/errors/enum.LeoError.html
+++ b/leo_errors/errors/enum.LeoError.html
@@ -13,16 +13,16 @@
}Expand description
The LeoError type that contains all sub error types.
This allows a unified error type throughout the Leo crates.
Variants§
§AstError(AstError)
Represents an AST Error in a Leo Error.
-§CliError(CliError)
Represents an CLI Error in a Leo Error.
-§CompilerError(CompilerError)
Represents an Compiler Error in a Leo Error.
-§PackageError(PackageError)
Represents an Package Error in a Leo Error.
-§ParserError(ParserError)
Represents an Parser Error in a Leo Error.
+§CliError(CliError)
Represents a CLI Error in a Leo Error.
+§CompilerError(CompilerError)
Represents a Compiler Error in a Leo Error.
+§PackageError(PackageError)
Represents a Package Error in a Leo Error.
+§ParserError(ParserError)
Represents a Parser Error in a Leo Error.
§TypeCheckerError(TypeCheckerError)
Represents a Type Checker Error in a Leo Error.
§LoopUnrollerError(LoopUnrollerError)
Represents a Loop Unroller Error in a Leo Error.
§FlattenError(FlattenError)
Represents a Flatten Error in a Leo Error.
§LastErrorCode(i32)
Purely for just exiting with the correct status code and
not re-displaying an error.
-§UtilError(UtilError)
Represents a Utils Error in a Leo Error
+§UtilError(UtilError)
Represents a Utils Error in a Leo Error.
§Anyhow(Error)
Anyhow errors.
Implementations§
source§impl LeoError
sourcepub fn error_code(&self) -> String
Implement error code for each type of Error.
sourcepub fn exit_code(&self) -> i32
Implement exit code for each type of Error.
diff --git a/leo_errors/errors/enum.LeoWarning.html b/leo_errors/errors/enum.LeoWarning.html
index 0faa5539be..c1588d6821 100644
--- a/leo_errors/errors/enum.LeoWarning.html
+++ b/leo_errors/errors/enum.LeoWarning.html
@@ -1,10 +1,10 @@
-LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
+LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
ParserWarning(ParserWarning),
TypeCheckerWarning(TypeCheckerWarning),
-}
Expand description
The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
-Variants§
§ParserWarning(ParserWarning)
Represents an Parser Error in a Leo Error.
-§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Error in a Leo Error.
+}Expand description
The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates.
+Variants§
§ParserWarning(ParserWarning)
Represents an Parser Warning in a Leo Warning.
+§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Warning in a Leo Warning.
Implementations§
source§impl LeoWarning
sourcepub fn error_code(&self) -> String
Implement warning code for each type of Warning.
Trait Implementations§
source§impl Debug for LeoWarning
source§impl Display for LeoWarning
source§impl Error for LeoWarning
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<ParserWarning> for LeoWarning
source§fn from(source: ParserWarning) -> Self
Converts to this type from the input type.source§impl From<TypeCheckerWarning> for LeoWarning
source§fn from(source: TypeCheckerWarning) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for LeoWarning
§impl RefUnwindSafe for LeoWarning
§impl Send for LeoWarning
§impl Sync for LeoWarning
§impl Unpin for LeoWarning
§impl UnwindSafe for LeoWarning
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_errors/errors/index.html b/leo_errors/errors/index.html
index a9aaa3418b..257932bad3 100644
--- a/leo_errors/errors/index.html
+++ b/leo_errors/errors/index.html
@@ -1,4 +1,4 @@
-leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo lang.
+leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo language.
Re-exports§
pub use self::ast::*;
pub use self::cli::*;
pub use self::compiler::*;
pub use self::flattener::*;
pub use self::loop_unroller::*;
pub use self::package::*;
pub use self::parser::*;
pub use self::type_checker::*;
pub use self::utils::*;
Modules§
- Contains the AST error definitions.
- Contains the CLI error definitions.
- Contains the Compiler error definitions.
- Contains the Flattener error definitions.
- Contains the Loop Unroller error definitions.
- Contains the Package error definitions.
- Contains the Parser error definitions.
- Contains the Type Checker error definitions.
- Contains the Utils error definitions.
Enums§
- The LeoError type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
- The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
+This allows a unified error type throughout the Leo crates.The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates. Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
diff --git a/leo_errors/index.html b/leo_errors/index.html
index da14ceb37f..5bbc7ccfbb 100644
--- a/leo_errors/index.html
+++ b/leo_errors/index.html
@@ -46,6 +46,6 @@ §SnarkVM
When SnarkVM implements better error codes and messages, we can bubble them up.
§Utils
The errors related to dependency retrieval in the utils
crate. Its error codes will range from 10_000-10_999 and be prefixed with the characters DEP
.
-
Re-exports§
Modules§
- Contains the common functionalities for defining errors..
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo lang.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
+
Re-exports§
Modules§
- Contains the common functionalities for defining errors.
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo language.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
and error methods generated through a DSL creates and generates errors
with a unique error code.
\ No newline at end of file
diff --git a/leo_package/build/directory/struct.BuildDirectory.html b/leo_package/build/directory/struct.BuildDirectory.html
index fac07569cb..3398708872 100644
--- a/leo_package/build/directory/struct.BuildDirectory.html
+++ b/leo_package/build/directory/struct.BuildDirectory.html
@@ -1,6 +1,6 @@
-BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
source§impl BuildDirectory
sourcepub fn open(path: &Path) -> Result<PathBuf>
Returns the path to the build directory if it exists.
-sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for BuildDirectory
§impl RefUnwindSafe for BuildDirectory
§impl Send for BuildDirectory
§impl Sync for BuildDirectory
§impl Unpin for BuildDirectory
§impl UnwindSafe for BuildDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/fn.parse_file_paths.html b/leo_package/fn.parse_file_paths.html
index 5e8c86b57f..32c80a43ae 100644
--- a/leo_package/fn.parse_file_paths.html
+++ b/leo_package/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package - Rust Function leo_package::parse_file_paths
source · pub(crate) fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/imports/directory/struct.ImportsDirectory.html b/leo_package/imports/directory/struct.ImportsDirectory.html
index f58c759e92..9885ee13dd 100644
--- a/leo_package/imports/directory/struct.ImportsDirectory.html
+++ b/leo_package/imports/directory/struct.ImportsDirectory.html
@@ -1,7 +1,7 @@
-ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name if it does not exist.
-sourcepub fn is_empty(path: &Path) -> Result<bool>
Returns true if the imports directory does not exist or does not contain files.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the imports directory.
+ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
Auto Trait Implementations§
§impl Freeze for ImportsDirectory
§impl RefUnwindSafe for ImportsDirectory
§impl Send for ImportsDirectory
§impl Sync for ImportsDirectory
§impl Unpin for ImportsDirectory
§impl UnwindSafe for ImportsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/inputs/directory/fn.parse_file_paths.html b/leo_package/inputs/directory/fn.parse_file_paths.html
index 1b5a58356c..bbc13fb6c2 100644
--- a/leo_package/inputs/directory/fn.parse_file_paths.html
+++ b/leo_package/inputs/directory/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package::inputs::directory - Rust Function leo_package::inputs::directory::parse_file_paths
source · fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/inputs/directory/struct.InputsDirectory.html b/leo_package/inputs/directory/struct.InputsDirectory.html
index 3be222239e..42e6487029 100644
--- a/leo_package/inputs/directory/struct.InputsDirectory.html
+++ b/leo_package/inputs/directory/struct.InputsDirectory.html
@@ -1,5 +1,5 @@
-InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
source§impl InputsDirectory
sourcepub fn create(path: &Path) -> Result<()>
Creates a directory at the provided path with the default directory name.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the input directory.
+InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for InputsDirectory
§impl RefUnwindSafe for InputsDirectory
§impl Send for InputsDirectory
§impl Sync for InputsDirectory
§impl Unpin for InputsDirectory
§impl UnwindSafe for InputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
index cb29b629d0..fd1493e673 100644
--- a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
+++ b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
@@ -3,8 +3,8 @@
pub snapshot: Snapshot,
}Expand description
Generic Snapshot file wrapper. Each package can have up to 3
different snapshots: initial_ast, canonicalization_ast and type_inferenced_ast;
-Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+
Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn snapshot_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for SnapshotFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for SnapshotFile
§impl RefUnwindSafe for SnapshotFile
§impl Send for SnapshotFile
§impl Sync for SnapshotFile
§impl Unpin for SnapshotFile
§impl UnwindSafe for SnapshotFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/checksum/struct.ChecksumFile.html b/leo_package/outputs/checksum/struct.ChecksumFile.html
index def0ba7fb2..a83b3f87ce 100644
--- a/leo_package/outputs/checksum/struct.ChecksumFile.html
+++ b/leo_package/outputs/checksum/struct.ChecksumFile.html
@@ -1,8 +1,8 @@
ChecksumFile in leo_package::outputs::checksum - Rust Struct leo_package::outputs::checksum::ChecksumFile
source · pub struct ChecksumFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for ChecksumFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ChecksumFile
§impl RefUnwindSafe for ChecksumFile
§impl Send for ChecksumFile
§impl Sync for ChecksumFile
§impl Unpin for ChecksumFile
§impl UnwindSafe for ChecksumFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/circuit/struct.CircuitFile.html b/leo_package/outputs/circuit/struct.CircuitFile.html
index 7a313cccc5..2016ebb713 100644
--- a/leo_package/outputs/circuit/struct.CircuitFile.html
+++ b/leo_package/outputs/circuit/struct.CircuitFile.html
@@ -1,8 +1,8 @@
CircuitFile in leo_package::outputs::circuit - Rust Struct leo_package::outputs::circuit::CircuitFile
source · pub struct CircuitFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for CircuitFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for CircuitFile
§impl RefUnwindSafe for CircuitFile
§impl Send for CircuitFile
§impl Sync for CircuitFile
§impl Unpin for CircuitFile
§impl UnwindSafe for CircuitFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/directory/struct.OutputsDirectory.html b/leo_package/outputs/directory/struct.OutputsDirectory.html
index e6c87e2ceb..eed4aadfb3 100644
--- a/leo_package/outputs/directory/struct.OutputsDirectory.html
+++ b/leo_package/outputs/directory/struct.OutputsDirectory.html
@@ -1,5 +1,5 @@
-OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
source§impl OutputsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for OutputsDirectory
§impl RefUnwindSafe for OutputsDirectory
§impl Send for OutputsDirectory
§impl Sync for OutputsDirectory
§impl Unpin for OutputsDirectory
§impl UnwindSafe for OutputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/package/struct.Package.html b/leo_package/package/struct.Package.html
index 5ddc7ad345..a169387912 100644
--- a/leo_package/package/struct.Package.html
+++ b/leo_package/package/struct.Package.html
@@ -3,8 +3,8 @@
pub version: String,
pub description: Option<String>,
pub license: Option<String>,
- pub network: NetworkName,
-}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
+ pub network: NetworkName,
+}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
Aleo names can only contain ASCII alphanumeric characters and underscores.
sourcepub fn can_initialize(package_name: &str, path: &Path) -> bool
Returns true
if a package is can be initialized at a given path.
impl<T> Any for Twhere
diff --git a/leo_ast/value/enum.Value.html b/leo_ast/value/enum.Value.html
index ac1e20e896..7564bd391f 100644
--- a/leo_ast/value/enum.Value.html
+++ b/leo_ast/value/enum.Value.html
@@ -17,10 +17,10 @@
U128(u128, Span),
Scalar(String, Span),
String(String, Span),
-}Variants§
§Input(Type, Identifier)
§Address(String, Span)
§Boolean(bool, Span)
§Struct(Identifier, IndexMap<Symbol, Value>)
§Field(String, Span)
§Group(Box<GroupLiteral>)
§I8(i8, Span)
§I16(i16, Span)
§I32(i32, Span)
§I64(i64, Span)
§I128(i128, Span)
§U8(u8, Span)
§U16(u16, Span)
§U32(u32, Span)
§U64(u64, Span)
§U128(u128, Span)
§Scalar(String, Span)
§String(String, Span)
Implementations§
source§impl Value
sourcepub(crate) fn abs(self, span: Span) -> Result<Self>
sourcepub(crate) fn abs_wrapped(self, span: Span) -> Result<Self>
sourcepub(crate) fn neg(self, span: Span) -> Result<Self>
sourcepub(crate) fn not(self, span: Span) -> Result<Self>
sourcepub(crate) fn add(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn add_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn bitand(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn div(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn div_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn eq(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn ge(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn gt(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn le(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn lt(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn mul(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn mul_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn bitor(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn pow(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn pow_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn shl(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn shl_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn shr(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn shr_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn sub(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn sub_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn xor(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn is_supported_const_fold_type(&self) -> bool
Trait Implementations§
source§impl PartialEq for Value
source§fn eq(&self, other: &Value) -> bool
This method tests for self
and other
values to be equal, and is used
+}Variants§
§Input(Type, Identifier)
§Address(String, Span)
§Boolean(bool, Span)
§Struct(Identifier, IndexMap<Symbol, Value>)
§Field(String, Span)
§Group(Box<GroupLiteral>)
§I8(i8, Span)
§I16(i16, Span)
§I32(i32, Span)
§I64(i64, Span)
§I128(i128, Span)
§U8(u8, Span)
§U16(u16, Span)
§U32(u32, Span)
§U64(u64, Span)
§U128(u128, Span)
§Scalar(String, Span)
§String(String, Span)
Implementations§
source§impl Value
sourcepub(crate) fn abs(self, span: Span) -> Result<Self>
sourcepub(crate) fn abs_wrapped(self, span: Span) -> Result<Self>
sourcepub(crate) fn neg(self, span: Span) -> Result<Self>
sourcepub(crate) fn not(self, span: Span) -> Result<Self>
sourcepub(crate) fn add(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn add_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn bitand(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn div(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn div_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn eq(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn ge(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn gt(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn le(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn lt(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn mul(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn mul_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn bitor(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn pow(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn pow_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn shl(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn shl_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn shr(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn shr_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn sub(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn sub_wrapped(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn xor(self, other: Self, span: Span) -> Result<Self>
sourcepub(crate) fn is_supported_const_fold_type(&self) -> bool
Trait Implementations§
source§impl PartialEq for Value
source§impl Eq for Value
source§impl StructuralPartialEq for Value
Auto Trait Implementations§
§impl Freeze for Value
§impl RefUnwindSafe for Value
§impl Send for Value
§impl Sync for Value
§impl Unpin for Value
§impl UnwindSafe for Value
Blanket Implementations§
source§impl Eq for Value
source§impl StructuralPartialEq for Value
Auto Trait Implementations§
§impl Freeze for Value
§impl RefUnwindSafe for Value
§impl Send for Value
§impl Sync for Value
§impl Unpin for Value
§impl UnwindSafe for Value
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<Q, K> Equivalent<K> for Qwhere
diff --git a/leo_compiler/compiler/struct.Ast.html b/leo_compiler/compiler/struct.Ast.html
index db4a3519ca..ff245a2179 100644
--- a/leo_compiler/compiler/struct.Ast.html
+++ b/leo_compiler/compiler/struct.Ast.html
@@ -5,20 +5,20 @@
These data types form a tree that begins from a Program
type root.
Fields§
§ast: Program
Implementations§
source§impl Ast
sourcepub fn as_repr(&self) -> &Program
Returns a reference to the inner program AST representation.
-sourcepub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
+
sourcepub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
Serializes the ast into a JSON file.
+) -> Result<(), LeoError>Serializes the ast into a JSON file.
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<Ast, LeoError>
Deserializes the JSON string into a ast.
-sourcepub fn from_json_file(path: PathBuf) -> Result<Ast, LeoError>
Trait Implementations§
source§impl Eq for Ast
source§impl StructuralPartialEq for Ast
Auto Trait Implementations§
§impl Freeze for Ast
§impl !RefUnwindSafe for Ast
§impl Send for Ast
§impl !Sync for Ast
§impl Unpin for Ast
§impl UnwindSafe for Ast
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_compiler/compiler/struct.Compiler.html b/leo_compiler/compiler/struct.Compiler.html
index 3d7910794c..fc6adb7839 100644
--- a/leo_compiler/compiler/struct.Compiler.html
+++ b/leo_compiler/compiler/struct.Compiler.html
@@ -1,5 +1,5 @@
Compiler in leo_compiler::compiler - Rust Struct leo_compiler::compiler::Compiler
source · pub struct Compiler<'a, N: Network> {
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
pub program_name: String,
@@ -9,10 +9,10 @@
node_builder: NodeBuilder,
assigner: Assigner,
type_table: TypeTable,
- import_stubs: IndexMap<Symbol, Stub>,
+ import_stubs: IndexMap<Symbol, Stub>,
phantom: PhantomData<N>,
}
Expand description
The primary entry point of the Leo compiler.
-Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
+Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
§main_file_path: PathBuf
The path to the main leo file.
§output_directory: PathBuf
The path to where the compiler outputs all generated files.
§program_name: String
The program name,
@@ -22,57 +22,57 @@
§node_builder: NodeBuilder
The NodeCounter
used to generate sequentially increasing NodeID
s.
§assigner: Assigner
The Assigner
is used to construct (unique) assignment statements.
§type_table: TypeTable
The type table.
-§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
+§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
§phantom: PhantomData<N>
Implementations§
source§impl<'a, N: Network> Compiler<'a, N>
sourcepub fn new(
program_name: String,
network: String,
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
compiler_options: Option<CompilerOptions>,
- import_stubs: IndexMap<Symbol, Stub>
+ import_stubs: IndexMap<Symbol, Stub>
) -> Self
Returns a new Leo compiler.
-sourcepub fn parse_program_from_string(
&mut self,
program_string: &str,
- name: FileName
-) -> Result<()>
Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
-sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
-sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
+ name: FileName
+) -> Result<()>Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
+sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
+sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
sourcepub fn type_checker_pass(
&'a self,
symbol_table: SymbolTable
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the type checker pass.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the type checker pass.
sourcepub fn loop_unrolling_pass(
&mut self,
symbol_table: SymbolTable
-) -> Result<SymbolTable>
Runs the loop unrolling pass.
+) -> Result<SymbolTable>Runs the loop unrolling pass.
sourcepub fn static_single_assignment_pass(
&mut self,
symbol_table: &SymbolTable
-) -> Result<()>
Runs the static single assignment pass.
-sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
-sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
-sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
-sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
+) -> Result<()>Runs the static single assignment pass.
+sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
+sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
+sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
+sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
sourcepub fn code_generation_pass(
&mut self,
symbol_table: &SymbolTable,
struct_graph: &StructGraph,
call_graph: &CallGraph
-) -> Result<String>
Runs the code generation pass.
+) -> Result<String>Runs the code generation pass.
sourcepub fn compiler_stages(
&mut self
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the compiler stages.
-sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the compiler stages.
+sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
sourcefn write_symbol_table_to_json(
&self,
file_suffix: &str,
symbol_table: &SymbolTable
-) -> Result<()>
Writes the Symbol Table to a JSON file.
-sourcepub fn add_import_stubs(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
§impl<'a, N> !Freeze for Compiler<'a, N>
§impl<'a, N> !RefUnwindSafe for Compiler<'a, N>
§impl<'a, N> !Send for Compiler<'a, N>
§impl<'a, N> !Sync for Compiler<'a, N>
§impl<'a, N> Unpin for Compiler<'a, N>where
N: Unpin,
§impl<'a, N> !UnwindSafe for Compiler<'a, N>
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_compiler/compiler/struct.SymbolTable.html b/leo_compiler/compiler/struct.SymbolTable.html
index dc00879288..7e990f1dc1 100644
--- a/leo_compiler/compiler/struct.SymbolTable.html
+++ b/leo_compiler/compiler/struct.SymbolTable.html
@@ -13,8 +13,8 @@
&self,
location: &Location,
is_struct: bool,
- span: Span
-) -> Result<(), LeoError>Recursively checks if the symbol table contains an entry for the given symbol.
+ span: Span
+) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol.
Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
Returns the current scope index.
Increments the scope index.
@@ -22,35 +22,35 @@
&mut self,
location: Location,
insert: &Function
-) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
-sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SymbolTable
source§impl Default for SymbolTable
source§fn default() -> SymbolTable
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_compiler/struct.Ast.html b/leo_compiler/struct.Ast.html
index ad68be994a..1e6b1d6afa 100644
--- a/leo_compiler/struct.Ast.html
+++ b/leo_compiler/struct.Ast.html
@@ -5,20 +5,20 @@
These data types form a tree that begins from a Program
type root.
Fields§
§ast: Program
Implementations§
source§impl Ast
sourcepub fn as_repr(&self) -> &Program
Returns a reference to the inner program AST representation.
-sourcepub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
+
sourcepub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
Serializes the ast into a JSON file.
+) -> Result<(), LeoError>Serializes the ast into a JSON file.
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<Ast, LeoError>
Deserializes the JSON string into a ast.
-sourcepub fn from_json_file(path: PathBuf) -> Result<Ast, LeoError>
Trait Implementations§
source§impl Eq for Ast
source§impl StructuralPartialEq for Ast
Auto Trait Implementations§
§impl Freeze for Ast
§impl !RefUnwindSafe for Ast
§impl Send for Ast
§impl !Sync for Ast
§impl Unpin for Ast
§impl UnwindSafe for Ast
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_compiler/struct.Compiler.html b/leo_compiler/struct.Compiler.html
index 3b92156fca..753a369be0 100644
--- a/leo_compiler/struct.Compiler.html
+++ b/leo_compiler/struct.Compiler.html
@@ -1,5 +1,5 @@
Compiler in leo_compiler - Rust Struct leo_compiler::Compiler
source · pub struct Compiler<'a, N: Network> {
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
pub program_name: String,
@@ -9,10 +9,10 @@
node_builder: NodeBuilder,
assigner: Assigner,
type_table: TypeTable,
- import_stubs: IndexMap<Symbol, Stub>,
+ import_stubs: IndexMap<Symbol, Stub>,
phantom: PhantomData<N>,
}
Expand description
The primary entry point of the Leo compiler.
-Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
+Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
§main_file_path: PathBuf
The path to the main leo file.
§output_directory: PathBuf
The path to where the compiler outputs all generated files.
§program_name: String
The program name,
@@ -22,57 +22,57 @@
§node_builder: NodeBuilder
The NodeCounter
used to generate sequentially increasing NodeID
s.
§assigner: Assigner
The Assigner
is used to construct (unique) assignment statements.
§type_table: TypeTable
The type table.
-§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
+§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
§phantom: PhantomData<N>
Implementations§
source§impl<'a, N: Network> Compiler<'a, N>
sourcepub fn new(
program_name: String,
network: String,
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
compiler_options: Option<CompilerOptions>,
- import_stubs: IndexMap<Symbol, Stub>
+ import_stubs: IndexMap<Symbol, Stub>
) -> Self
Returns a new Leo compiler.
-sourcepub fn parse_program_from_string(
&mut self,
program_string: &str,
- name: FileName
-) -> Result<()>
Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
-sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
-sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
+ name: FileName
+) -> Result<()>Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
+sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
+sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
sourcepub fn type_checker_pass(
&'a self,
symbol_table: SymbolTable
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the type checker pass.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the type checker pass.
sourcepub fn loop_unrolling_pass(
&mut self,
symbol_table: SymbolTable
-) -> Result<SymbolTable>
Runs the loop unrolling pass.
+) -> Result<SymbolTable>Runs the loop unrolling pass.
sourcepub fn static_single_assignment_pass(
&mut self,
symbol_table: &SymbolTable
-) -> Result<()>
Runs the static single assignment pass.
-sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
-sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
-sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
-sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
+) -> Result<()>Runs the static single assignment pass.
+sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
+sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
+sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
+sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
sourcepub fn code_generation_pass(
&mut self,
symbol_table: &SymbolTable,
struct_graph: &StructGraph,
call_graph: &CallGraph
-) -> Result<String>
Runs the code generation pass.
+) -> Result<String>Runs the code generation pass.
sourcepub fn compiler_stages(
&mut self
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the compiler stages.
-sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the compiler stages.
+sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
sourcefn write_symbol_table_to_json(
&self,
file_suffix: &str,
symbol_table: &SymbolTable
-) -> Result<()>
Writes the Symbol Table to a JSON file.
-sourcepub fn add_import_stubs(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
§impl<'a, N> !Freeze for Compiler<'a, N>
§impl<'a, N> !RefUnwindSafe for Compiler<'a, N>
§impl<'a, N> !Send for Compiler<'a, N>
§impl<'a, N> !Sync for Compiler<'a, N>
§impl<'a, N> Unpin for Compiler<'a, N>where
N: Unpin,
§impl<'a, N> !UnwindSafe for Compiler<'a, N>
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_compiler/struct.SymbolTable.html b/leo_compiler/struct.SymbolTable.html
index abd12cc7c0..cf23f3f321 100644
--- a/leo_compiler/struct.SymbolTable.html
+++ b/leo_compiler/struct.SymbolTable.html
@@ -13,8 +13,8 @@
&self,
location: &Location,
is_struct: bool,
- span: Span
-) -> Result<(), LeoError>Recursively checks if the symbol table contains an entry for the given symbol.
+ span: Span
+) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol.
Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
Returns the current scope index.
Increments the scope index.
@@ -22,35 +22,35 @@
&mut self,
location: Location,
insert: &Function
-) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
-sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SymbolTable
source§impl Default for SymbolTable
source§fn default() -> SymbolTable
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_disassembler/fn.disassemble_from_str.html b/leo_disassembler/fn.disassemble_from_str.html
index 0dc23c5ffd..73dd2bcdf6 100644
--- a/leo_disassembler/fn.disassemble_from_str.html
+++ b/leo_disassembler/fn.disassemble_from_str.html
@@ -1,4 +1,4 @@
disassemble_from_str in leo_disassembler - Rust Function leo_disassembler::disassemble_from_str
source · pub fn disassemble_from_str<N: Network>(
name: &str,
program: &str
-) -> Result<Stub, UtilError>
\ No newline at end of file
+) -> Result<Stub, UtilError>
\ No newline at end of file
diff --git a/leo_errors/common/index.html b/leo_errors/common/index.html
index 9823564797..7349584cbe 100644
--- a/leo_errors/common/index.html
+++ b/leo_errors/common/index.html
@@ -1,2 +1,2 @@
-leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors..
+leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors.
Re-exports§
pub use self::backtraced::*;
pub use self::formatted::*;
pub use self::traits::*;
Modules§
- This module contains a backtraced error and its methods.
- This module contains a formatted error and its methods.
- This module contains the macros for making errors easily.
- This module contains traits for making errors easily.
\ No newline at end of file
diff --git a/leo_errors/errors/enum.LeoError.html b/leo_errors/errors/enum.LeoError.html
index 14a74cc5b9..8ec7a32fc3 100644
--- a/leo_errors/errors/enum.LeoError.html
+++ b/leo_errors/errors/enum.LeoError.html
@@ -13,16 +13,16 @@
}Expand description
The LeoError type that contains all sub error types.
This allows a unified error type throughout the Leo crates.
Variants§
§AstError(AstError)
Represents an AST Error in a Leo Error.
-§CliError(CliError)
Represents an CLI Error in a Leo Error.
-§CompilerError(CompilerError)
Represents an Compiler Error in a Leo Error.
-§PackageError(PackageError)
Represents an Package Error in a Leo Error.
-§ParserError(ParserError)
Represents an Parser Error in a Leo Error.
+§CliError(CliError)
Represents a CLI Error in a Leo Error.
+§CompilerError(CompilerError)
Represents a Compiler Error in a Leo Error.
+§PackageError(PackageError)
Represents a Package Error in a Leo Error.
+§ParserError(ParserError)
Represents a Parser Error in a Leo Error.
§TypeCheckerError(TypeCheckerError)
Represents a Type Checker Error in a Leo Error.
§LoopUnrollerError(LoopUnrollerError)
Represents a Loop Unroller Error in a Leo Error.
§FlattenError(FlattenError)
Represents a Flatten Error in a Leo Error.
§LastErrorCode(i32)
Purely for just exiting with the correct status code and
not re-displaying an error.
-§UtilError(UtilError)
Represents a Utils Error in a Leo Error
+§UtilError(UtilError)
Represents a Utils Error in a Leo Error.
§Anyhow(Error)
Anyhow errors.
Implementations§
source§impl LeoError
sourcepub fn error_code(&self) -> String
Implement error code for each type of Error.
sourcepub fn exit_code(&self) -> i32
Implement exit code for each type of Error.
diff --git a/leo_errors/errors/enum.LeoWarning.html b/leo_errors/errors/enum.LeoWarning.html
index 0faa5539be..c1588d6821 100644
--- a/leo_errors/errors/enum.LeoWarning.html
+++ b/leo_errors/errors/enum.LeoWarning.html
@@ -1,10 +1,10 @@
-LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
+LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
ParserWarning(ParserWarning),
TypeCheckerWarning(TypeCheckerWarning),
-}
Expand description
The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
-Variants§
§ParserWarning(ParserWarning)
Represents an Parser Error in a Leo Error.
-§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Error in a Leo Error.
+}Expand description
The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates.
+Variants§
§ParserWarning(ParserWarning)
Represents an Parser Warning in a Leo Warning.
+§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Warning in a Leo Warning.
Implementations§
source§impl LeoWarning
sourcepub fn error_code(&self) -> String
Implement warning code for each type of Warning.
Trait Implementations§
source§impl Debug for LeoWarning
source§impl Display for LeoWarning
source§impl Error for LeoWarning
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<ParserWarning> for LeoWarning
source§fn from(source: ParserWarning) -> Self
Converts to this type from the input type.source§impl From<TypeCheckerWarning> for LeoWarning
source§fn from(source: TypeCheckerWarning) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for LeoWarning
§impl RefUnwindSafe for LeoWarning
§impl Send for LeoWarning
§impl Sync for LeoWarning
§impl Unpin for LeoWarning
§impl UnwindSafe for LeoWarning
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_errors/errors/index.html b/leo_errors/errors/index.html
index a9aaa3418b..257932bad3 100644
--- a/leo_errors/errors/index.html
+++ b/leo_errors/errors/index.html
@@ -1,4 +1,4 @@
-leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo lang.
+leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo language.
Re-exports§
pub use self::ast::*;
pub use self::cli::*;
pub use self::compiler::*;
pub use self::flattener::*;
pub use self::loop_unroller::*;
pub use self::package::*;
pub use self::parser::*;
pub use self::type_checker::*;
pub use self::utils::*;
Modules§
- Contains the AST error definitions.
- Contains the CLI error definitions.
- Contains the Compiler error definitions.
- Contains the Flattener error definitions.
- Contains the Loop Unroller error definitions.
- Contains the Package error definitions.
- Contains the Parser error definitions.
- Contains the Type Checker error definitions.
- Contains the Utils error definitions.
Enums§
- The LeoError type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
- The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
+This allows a unified error type throughout the Leo crates.The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates. Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
diff --git a/leo_errors/index.html b/leo_errors/index.html
index da14ceb37f..5bbc7ccfbb 100644
--- a/leo_errors/index.html
+++ b/leo_errors/index.html
@@ -46,6 +46,6 @@ §SnarkVM
When SnarkVM implements better error codes and messages, we can bubble them up.
§Utils
The errors related to dependency retrieval in the utils
crate. Its error codes will range from 10_000-10_999 and be prefixed with the characters DEP
.
-
Re-exports§
Modules§
- Contains the common functionalities for defining errors..
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo lang.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
+
Re-exports§
Modules§
- Contains the common functionalities for defining errors.
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo language.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
and error methods generated through a DSL creates and generates errors
with a unique error code.
\ No newline at end of file
diff --git a/leo_package/build/directory/struct.BuildDirectory.html b/leo_package/build/directory/struct.BuildDirectory.html
index fac07569cb..3398708872 100644
--- a/leo_package/build/directory/struct.BuildDirectory.html
+++ b/leo_package/build/directory/struct.BuildDirectory.html
@@ -1,6 +1,6 @@
-BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
source§impl BuildDirectory
sourcepub fn open(path: &Path) -> Result<PathBuf>
Returns the path to the build directory if it exists.
-sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for BuildDirectory
§impl RefUnwindSafe for BuildDirectory
§impl Send for BuildDirectory
§impl Sync for BuildDirectory
§impl Unpin for BuildDirectory
§impl UnwindSafe for BuildDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/fn.parse_file_paths.html b/leo_package/fn.parse_file_paths.html
index 5e8c86b57f..32c80a43ae 100644
--- a/leo_package/fn.parse_file_paths.html
+++ b/leo_package/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package - Rust Function leo_package::parse_file_paths
source · pub(crate) fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/imports/directory/struct.ImportsDirectory.html b/leo_package/imports/directory/struct.ImportsDirectory.html
index f58c759e92..9885ee13dd 100644
--- a/leo_package/imports/directory/struct.ImportsDirectory.html
+++ b/leo_package/imports/directory/struct.ImportsDirectory.html
@@ -1,7 +1,7 @@
-ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name if it does not exist.
-sourcepub fn is_empty(path: &Path) -> Result<bool>
Returns true if the imports directory does not exist or does not contain files.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the imports directory.
+ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
Auto Trait Implementations§
§impl Freeze for ImportsDirectory
§impl RefUnwindSafe for ImportsDirectory
§impl Send for ImportsDirectory
§impl Sync for ImportsDirectory
§impl Unpin for ImportsDirectory
§impl UnwindSafe for ImportsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/inputs/directory/fn.parse_file_paths.html b/leo_package/inputs/directory/fn.parse_file_paths.html
index 1b5a58356c..bbc13fb6c2 100644
--- a/leo_package/inputs/directory/fn.parse_file_paths.html
+++ b/leo_package/inputs/directory/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package::inputs::directory - Rust Function leo_package::inputs::directory::parse_file_paths
source · fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/inputs/directory/struct.InputsDirectory.html b/leo_package/inputs/directory/struct.InputsDirectory.html
index 3be222239e..42e6487029 100644
--- a/leo_package/inputs/directory/struct.InputsDirectory.html
+++ b/leo_package/inputs/directory/struct.InputsDirectory.html
@@ -1,5 +1,5 @@
-InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
source§impl InputsDirectory
sourcepub fn create(path: &Path) -> Result<()>
Creates a directory at the provided path with the default directory name.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the input directory.
+InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for InputsDirectory
§impl RefUnwindSafe for InputsDirectory
§impl Send for InputsDirectory
§impl Sync for InputsDirectory
§impl Unpin for InputsDirectory
§impl UnwindSafe for InputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
index cb29b629d0..fd1493e673 100644
--- a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
+++ b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
@@ -3,8 +3,8 @@
pub snapshot: Snapshot,
}Expand description
Generic Snapshot file wrapper. Each package can have up to 3
different snapshots: initial_ast, canonicalization_ast and type_inferenced_ast;
-Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+
Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn snapshot_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for SnapshotFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for SnapshotFile
§impl RefUnwindSafe for SnapshotFile
§impl Send for SnapshotFile
§impl Sync for SnapshotFile
§impl Unpin for SnapshotFile
§impl UnwindSafe for SnapshotFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/checksum/struct.ChecksumFile.html b/leo_package/outputs/checksum/struct.ChecksumFile.html
index def0ba7fb2..a83b3f87ce 100644
--- a/leo_package/outputs/checksum/struct.ChecksumFile.html
+++ b/leo_package/outputs/checksum/struct.ChecksumFile.html
@@ -1,8 +1,8 @@
ChecksumFile in leo_package::outputs::checksum - Rust Struct leo_package::outputs::checksum::ChecksumFile
source · pub struct ChecksumFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for ChecksumFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ChecksumFile
§impl RefUnwindSafe for ChecksumFile
§impl Send for ChecksumFile
§impl Sync for ChecksumFile
§impl Unpin for ChecksumFile
§impl UnwindSafe for ChecksumFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/circuit/struct.CircuitFile.html b/leo_package/outputs/circuit/struct.CircuitFile.html
index 7a313cccc5..2016ebb713 100644
--- a/leo_package/outputs/circuit/struct.CircuitFile.html
+++ b/leo_package/outputs/circuit/struct.CircuitFile.html
@@ -1,8 +1,8 @@
CircuitFile in leo_package::outputs::circuit - Rust Struct leo_package::outputs::circuit::CircuitFile
source · pub struct CircuitFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for CircuitFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for CircuitFile
§impl RefUnwindSafe for CircuitFile
§impl Send for CircuitFile
§impl Sync for CircuitFile
§impl Unpin for CircuitFile
§impl UnwindSafe for CircuitFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/directory/struct.OutputsDirectory.html b/leo_package/outputs/directory/struct.OutputsDirectory.html
index e6c87e2ceb..eed4aadfb3 100644
--- a/leo_package/outputs/directory/struct.OutputsDirectory.html
+++ b/leo_package/outputs/directory/struct.OutputsDirectory.html
@@ -1,5 +1,5 @@
-OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
source§impl OutputsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for OutputsDirectory
§impl RefUnwindSafe for OutputsDirectory
§impl Send for OutputsDirectory
§impl Sync for OutputsDirectory
§impl Unpin for OutputsDirectory
§impl UnwindSafe for OutputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/package/struct.Package.html b/leo_package/package/struct.Package.html
index 5ddc7ad345..a169387912 100644
--- a/leo_package/package/struct.Package.html
+++ b/leo_package/package/struct.Package.html
@@ -3,8 +3,8 @@
pub version: String,
pub description: Option<String>,
pub license: Option<String>,
- pub network: NetworkName,
-}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
+ pub network: NetworkName,
+}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
Aleo names can only contain ASCII alphanumeric characters and underscores.
sourcepub fn can_initialize(package_name: &str, path: &Path) -> bool
Returns true
if a package is can be initialized at a given path.
Variants§
Input(Type, Identifier)
Address(String, Span)
Boolean(bool, Span)
Struct(Identifier, IndexMap<Symbol, Value>)
Field(String, Span)
Group(Box<GroupLiteral>)
I8(i8, Span)
I16(i16, Span)
I32(i32, Span)
I64(i64, Span)
I128(i128, Span)
U8(u8, Span)
U16(u16, Span)
U32(u32, Span)
U64(u64, Span)
U128(u128, Span)
Scalar(String, Span)
String(String, Span)
Implementations§
source§impl Value
impl Value
pub(crate) fn abs(self, span: Span) -> Result<Self>
pub(crate) fn abs_wrapped(self, span: Span) -> Result<Self>
pub(crate) fn neg(self, span: Span) -> Result<Self>
pub(crate) fn not(self, span: Span) -> Result<Self>
pub(crate) fn add(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn add_wrapped(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn bitand(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn div(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn div_wrapped(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn eq(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn ge(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn gt(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn le(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn lt(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn mul(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn mul_wrapped(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn bitor(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn pow(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn pow_wrapped(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn shl(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn shl_wrapped(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn shr(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn shr_wrapped(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn sub(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn sub_wrapped(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn xor(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn is_supported_const_fold_type(&self) -> bool
Trait Implementations§
source§impl PartialEq for Value
impl PartialEq for Value
source§fn eq(&self, other: &Value) -> bool
fn eq(&self, other: &Value) -> bool
self
and other
values to be equal, and is used
+}Variants§
Input(Type, Identifier)
Address(String, Span)
Boolean(bool, Span)
Struct(Identifier, IndexMap<Symbol, Value>)
Field(String, Span)
Group(Box<GroupLiteral>)
I8(i8, Span)
I16(i16, Span)
I32(i32, Span)
I64(i64, Span)
I128(i128, Span)
U8(u8, Span)
U16(u16, Span)
U32(u32, Span)
U64(u64, Span)
U128(u128, Span)
Scalar(String, Span)
String(String, Span)
Implementations§
source§impl Value
impl Value
pub(crate) fn abs(self, span: Span) -> Result<Self>
pub(crate) fn abs_wrapped(self, span: Span) -> Result<Self>
pub(crate) fn neg(self, span: Span) -> Result<Self>
pub(crate) fn not(self, span: Span) -> Result<Self>
pub(crate) fn add(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn add_wrapped(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn bitand(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn div(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn div_wrapped(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn eq(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn ge(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn gt(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn le(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn lt(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn mul(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn mul_wrapped(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn bitor(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn pow(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn pow_wrapped(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn shl(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn shl_wrapped(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn shr(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn shr_wrapped(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn sub(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn sub_wrapped(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn xor(self, other: Self, span: Span) -> Result<Self>
pub(crate) fn is_supported_const_fold_type(&self) -> bool
Trait Implementations§
source§impl PartialEq for Value
impl PartialEq for Value
impl Eq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations§
impl Eq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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<Q, K> Equivalent<K> for Qwhere
diff --git a/leo_compiler/compiler/struct.Ast.html b/leo_compiler/compiler/struct.Ast.html
index db4a3519ca..ff245a2179 100644
--- a/leo_compiler/compiler/struct.Ast.html
+++ b/leo_compiler/compiler/struct.Ast.html
@@ -5,20 +5,20 @@
These data types form a tree that begins from a Program
type root.
impl<Q, K> Equivalent<K> for Qwhere
diff --git a/leo_compiler/compiler/struct.Ast.html b/leo_compiler/compiler/struct.Ast.html
index db4a3519ca..ff245a2179 100644
--- a/leo_compiler/compiler/struct.Ast.html
+++ b/leo_compiler/compiler/struct.Ast.html
@@ -5,20 +5,20 @@
These data types form a tree that begins from a Program
type root.
Program
type root.
Fields§
§ast: Program
Implementations§
source§impl Ast
impl Ast
sourcepub fn as_repr(&self) -> &Program
pub fn as_repr(&self) -> &Program
Returns a reference to the inner program AST representation.
-pub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
pub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
-pub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
+
pub fn to_json_file( +
pub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
pub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
+pub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
pub fn to_json_file( &self, path: PathBuf, file_name: &str -) -> Result<(), LeoError>
Serializes the ast into a JSON file.
+) -> Result<(), LeoError>Serializes the ast into a JSON file.
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
pub fn to_json_file_without_keys( &self, path: PathBuf, file_name: &str, excluded_keys: &[&str] -) -> Result<(), LeoError>
Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<Ast, LeoError>
pub fn from_json_string(json: &str) -> Result<Ast, LeoError>
Deserializes the JSON string into a ast.
-sourcepub fn from_json_file(path: PathBuf) -> Result<Ast, LeoError>
pub fn from_json_file(path: PathBuf) -> Result<Ast, LeoError>
Trait Implementations§
impl Eq for Ast
impl StructuralPartialEq for Ast
Auto Trait Implementations§
impl Freeze for Ast
impl !RefUnwindSafe for Ast
impl Send for Ast
impl !Sync for Ast
impl Unpin for Ast
impl UnwindSafe for Ast
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_compiler/compiler/struct.Compiler.html b/leo_compiler/compiler/struct.Compiler.html
index 3d7910794c..fc6adb7839 100644
--- a/leo_compiler/compiler/struct.Compiler.html
+++ b/leo_compiler/compiler/struct.Compiler.html
@@ -1,5 +1,5 @@
Compiler in leo_compiler::compiler - Rust Struct leo_compiler::compiler::Compiler
source · pub struct Compiler<'a, N: Network> {
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
pub program_name: String,
@@ -9,10 +9,10 @@
node_builder: NodeBuilder,
assigner: Assigner,
type_table: TypeTable,
- import_stubs: IndexMap<Symbol, Stub>,
+ import_stubs: IndexMap<Symbol, Stub>,
phantom: PhantomData<N>,
}
Expand description
The primary entry point of the Leo compiler.
-Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
+Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
§main_file_path: PathBuf
The path to the main leo file.
§output_directory: PathBuf
The path to where the compiler outputs all generated files.
§program_name: String
The program name,
@@ -22,57 +22,57 @@
§node_builder: NodeBuilder
The NodeCounter
used to generate sequentially increasing NodeID
s.
§assigner: Assigner
The Assigner
is used to construct (unique) assignment statements.
§type_table: TypeTable
The type table.
-§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
+§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
§phantom: PhantomData<N>
Implementations§
source§impl<'a, N: Network> Compiler<'a, N>
sourcepub fn new(
program_name: String,
network: String,
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
compiler_options: Option<CompilerOptions>,
- import_stubs: IndexMap<Symbol, Stub>
+ import_stubs: IndexMap<Symbol, Stub>
) -> Self
Returns a new Leo compiler.
-sourcepub fn parse_program_from_string(
&mut self,
program_string: &str,
- name: FileName
-) -> Result<()>
Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
-sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
-sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
+ name: FileName
+) -> Result<()>Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
+sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
+sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
sourcepub fn type_checker_pass(
&'a self,
symbol_table: SymbolTable
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the type checker pass.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the type checker pass.
sourcepub fn loop_unrolling_pass(
&mut self,
symbol_table: SymbolTable
-) -> Result<SymbolTable>
Runs the loop unrolling pass.
+) -> Result<SymbolTable>Runs the loop unrolling pass.
sourcepub fn static_single_assignment_pass(
&mut self,
symbol_table: &SymbolTable
-) -> Result<()>
Runs the static single assignment pass.
-sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
-sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
-sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
-sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
+) -> Result<()>Runs the static single assignment pass.
+sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
+sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
+sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
+sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
sourcepub fn code_generation_pass(
&mut self,
symbol_table: &SymbolTable,
struct_graph: &StructGraph,
call_graph: &CallGraph
-) -> Result<String>
Runs the code generation pass.
+) -> Result<String>Runs the code generation pass.
sourcepub fn compiler_stages(
&mut self
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the compiler stages.
-sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the compiler stages.
+sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
sourcefn write_symbol_table_to_json(
&self,
file_suffix: &str,
symbol_table: &SymbolTable
-) -> Result<()>
Writes the Symbol Table to a JSON file.
-sourcepub fn add_import_stubs(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
§impl<'a, N> !Freeze for Compiler<'a, N>
§impl<'a, N> !RefUnwindSafe for Compiler<'a, N>
§impl<'a, N> !Send for Compiler<'a, N>
§impl<'a, N> !Sync for Compiler<'a, N>
§impl<'a, N> Unpin for Compiler<'a, N>where
N: Unpin,
§impl<'a, N> !UnwindSafe for Compiler<'a, N>
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_compiler/compiler/struct.SymbolTable.html b/leo_compiler/compiler/struct.SymbolTable.html
index dc00879288..7e990f1dc1 100644
--- a/leo_compiler/compiler/struct.SymbolTable.html
+++ b/leo_compiler/compiler/struct.SymbolTable.html
@@ -13,8 +13,8 @@
&self,
location: &Location,
is_struct: bool,
- span: Span
-) -> Result<(), LeoError>Recursively checks if the symbol table contains an entry for the given symbol.
+ span: Span
+) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol.
Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
Returns the current scope index.
Increments the scope index.
@@ -22,35 +22,35 @@
&mut self,
location: Location,
insert: &Function
-) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
-sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SymbolTable
source§impl Default for SymbolTable
source§fn default() -> SymbolTable
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_compiler/struct.Ast.html b/leo_compiler/struct.Ast.html
index ad68be994a..1e6b1d6afa 100644
--- a/leo_compiler/struct.Ast.html
+++ b/leo_compiler/struct.Ast.html
@@ -5,20 +5,20 @@
These data types form a tree that begins from a Program
type root.
Fields§
§ast: Program
Implementations§
source§impl Ast
sourcepub fn as_repr(&self) -> &Program
Returns a reference to the inner program AST representation.
-sourcepub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
+
sourcepub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
Serializes the ast into a JSON file.
+) -> Result<(), LeoError>Serializes the ast into a JSON file.
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<Ast, LeoError>
Deserializes the JSON string into a ast.
-sourcepub fn from_json_file(path: PathBuf) -> Result<Ast, LeoError>
Trait Implementations§
source§impl Eq for Ast
source§impl StructuralPartialEq for Ast
Auto Trait Implementations§
§impl Freeze for Ast
§impl !RefUnwindSafe for Ast
§impl Send for Ast
§impl !Sync for Ast
§impl Unpin for Ast
§impl UnwindSafe for Ast
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_compiler/struct.Compiler.html b/leo_compiler/struct.Compiler.html
index 3b92156fca..753a369be0 100644
--- a/leo_compiler/struct.Compiler.html
+++ b/leo_compiler/struct.Compiler.html
@@ -1,5 +1,5 @@
Compiler in leo_compiler - Rust Struct leo_compiler::Compiler
source · pub struct Compiler<'a, N: Network> {
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
pub program_name: String,
@@ -9,10 +9,10 @@
node_builder: NodeBuilder,
assigner: Assigner,
type_table: TypeTable,
- import_stubs: IndexMap<Symbol, Stub>,
+ import_stubs: IndexMap<Symbol, Stub>,
phantom: PhantomData<N>,
}
Expand description
The primary entry point of the Leo compiler.
-Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
+Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
§main_file_path: PathBuf
The path to the main leo file.
§output_directory: PathBuf
The path to where the compiler outputs all generated files.
§program_name: String
The program name,
@@ -22,57 +22,57 @@
§node_builder: NodeBuilder
The NodeCounter
used to generate sequentially increasing NodeID
s.
§assigner: Assigner
The Assigner
is used to construct (unique) assignment statements.
§type_table: TypeTable
The type table.
-§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
+§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
§phantom: PhantomData<N>
Implementations§
source§impl<'a, N: Network> Compiler<'a, N>
sourcepub fn new(
program_name: String,
network: String,
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
compiler_options: Option<CompilerOptions>,
- import_stubs: IndexMap<Symbol, Stub>
+ import_stubs: IndexMap<Symbol, Stub>
) -> Self
Returns a new Leo compiler.
-sourcepub fn parse_program_from_string(
&mut self,
program_string: &str,
- name: FileName
-) -> Result<()>
Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
-sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
-sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
+ name: FileName
+) -> Result<()>Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
+sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
+sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
sourcepub fn type_checker_pass(
&'a self,
symbol_table: SymbolTable
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the type checker pass.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the type checker pass.
sourcepub fn loop_unrolling_pass(
&mut self,
symbol_table: SymbolTable
-) -> Result<SymbolTable>
Runs the loop unrolling pass.
+) -> Result<SymbolTable>Runs the loop unrolling pass.
sourcepub fn static_single_assignment_pass(
&mut self,
symbol_table: &SymbolTable
-) -> Result<()>
Runs the static single assignment pass.
-sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
-sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
-sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
-sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
+) -> Result<()>Runs the static single assignment pass.
+sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
+sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
+sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
+sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
sourcepub fn code_generation_pass(
&mut self,
symbol_table: &SymbolTable,
struct_graph: &StructGraph,
call_graph: &CallGraph
-) -> Result<String>
Runs the code generation pass.
+) -> Result<String>Runs the code generation pass.
sourcepub fn compiler_stages(
&mut self
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the compiler stages.
-sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the compiler stages.
+sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
sourcefn write_symbol_table_to_json(
&self,
file_suffix: &str,
symbol_table: &SymbolTable
-) -> Result<()>
Writes the Symbol Table to a JSON file.
-sourcepub fn add_import_stubs(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
§impl<'a, N> !Freeze for Compiler<'a, N>
§impl<'a, N> !RefUnwindSafe for Compiler<'a, N>
§impl<'a, N> !Send for Compiler<'a, N>
§impl<'a, N> !Sync for Compiler<'a, N>
§impl<'a, N> Unpin for Compiler<'a, N>where
N: Unpin,
§impl<'a, N> !UnwindSafe for Compiler<'a, N>
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_compiler/struct.SymbolTable.html b/leo_compiler/struct.SymbolTable.html
index abd12cc7c0..cf23f3f321 100644
--- a/leo_compiler/struct.SymbolTable.html
+++ b/leo_compiler/struct.SymbolTable.html
@@ -13,8 +13,8 @@
&self,
location: &Location,
is_struct: bool,
- span: Span
-) -> Result<(), LeoError>Recursively checks if the symbol table contains an entry for the given symbol.
+ span: Span
+) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol.
Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
Returns the current scope index.
Increments the scope index.
@@ -22,35 +22,35 @@
&mut self,
location: Location,
insert: &Function
-) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
-sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SymbolTable
source§impl Default for SymbolTable
source§fn default() -> SymbolTable
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_disassembler/fn.disassemble_from_str.html b/leo_disassembler/fn.disassemble_from_str.html
index 0dc23c5ffd..73dd2bcdf6 100644
--- a/leo_disassembler/fn.disassemble_from_str.html
+++ b/leo_disassembler/fn.disassemble_from_str.html
@@ -1,4 +1,4 @@
disassemble_from_str in leo_disassembler - Rust Function leo_disassembler::disassemble_from_str
source · pub fn disassemble_from_str<N: Network>(
name: &str,
program: &str
-) -> Result<Stub, UtilError>
\ No newline at end of file
+) -> Result<Stub, UtilError>
\ No newline at end of file
diff --git a/leo_errors/common/index.html b/leo_errors/common/index.html
index 9823564797..7349584cbe 100644
--- a/leo_errors/common/index.html
+++ b/leo_errors/common/index.html
@@ -1,2 +1,2 @@
-leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors..
+leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors.
Re-exports§
pub use self::backtraced::*;
pub use self::formatted::*;
pub use self::traits::*;
Modules§
- This module contains a backtraced error and its methods.
- This module contains a formatted error and its methods.
- This module contains the macros for making errors easily.
- This module contains traits for making errors easily.
\ No newline at end of file
diff --git a/leo_errors/errors/enum.LeoError.html b/leo_errors/errors/enum.LeoError.html
index 14a74cc5b9..8ec7a32fc3 100644
--- a/leo_errors/errors/enum.LeoError.html
+++ b/leo_errors/errors/enum.LeoError.html
@@ -13,16 +13,16 @@
}Expand description
The LeoError type that contains all sub error types.
This allows a unified error type throughout the Leo crates.
Variants§
§AstError(AstError)
Represents an AST Error in a Leo Error.
-§CliError(CliError)
Represents an CLI Error in a Leo Error.
-§CompilerError(CompilerError)
Represents an Compiler Error in a Leo Error.
-§PackageError(PackageError)
Represents an Package Error in a Leo Error.
-§ParserError(ParserError)
Represents an Parser Error in a Leo Error.
+§CliError(CliError)
Represents a CLI Error in a Leo Error.
+§CompilerError(CompilerError)
Represents a Compiler Error in a Leo Error.
+§PackageError(PackageError)
Represents a Package Error in a Leo Error.
+§ParserError(ParserError)
Represents a Parser Error in a Leo Error.
§TypeCheckerError(TypeCheckerError)
Represents a Type Checker Error in a Leo Error.
§LoopUnrollerError(LoopUnrollerError)
Represents a Loop Unroller Error in a Leo Error.
§FlattenError(FlattenError)
Represents a Flatten Error in a Leo Error.
§LastErrorCode(i32)
Purely for just exiting with the correct status code and
not re-displaying an error.
-§UtilError(UtilError)
Represents a Utils Error in a Leo Error
+§UtilError(UtilError)
Represents a Utils Error in a Leo Error.
§Anyhow(Error)
Anyhow errors.
Implementations§
source§impl LeoError
sourcepub fn error_code(&self) -> String
Implement error code for each type of Error.
sourcepub fn exit_code(&self) -> i32
Implement exit code for each type of Error.
diff --git a/leo_errors/errors/enum.LeoWarning.html b/leo_errors/errors/enum.LeoWarning.html
index 0faa5539be..c1588d6821 100644
--- a/leo_errors/errors/enum.LeoWarning.html
+++ b/leo_errors/errors/enum.LeoWarning.html
@@ -1,10 +1,10 @@
-LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
+LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
ParserWarning(ParserWarning),
TypeCheckerWarning(TypeCheckerWarning),
-}
Expand description
The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
-Variants§
§ParserWarning(ParserWarning)
Represents an Parser Error in a Leo Error.
-§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Error in a Leo Error.
+}Expand description
The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates.
+Variants§
§ParserWarning(ParserWarning)
Represents an Parser Warning in a Leo Warning.
+§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Warning in a Leo Warning.
Implementations§
source§impl LeoWarning
sourcepub fn error_code(&self) -> String
Implement warning code for each type of Warning.
Trait Implementations§
source§impl Debug for LeoWarning
source§impl Display for LeoWarning
source§impl Error for LeoWarning
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<ParserWarning> for LeoWarning
source§fn from(source: ParserWarning) -> Self
Converts to this type from the input type.source§impl From<TypeCheckerWarning> for LeoWarning
source§fn from(source: TypeCheckerWarning) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for LeoWarning
§impl RefUnwindSafe for LeoWarning
§impl Send for LeoWarning
§impl Sync for LeoWarning
§impl Unpin for LeoWarning
§impl UnwindSafe for LeoWarning
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_errors/errors/index.html b/leo_errors/errors/index.html
index a9aaa3418b..257932bad3 100644
--- a/leo_errors/errors/index.html
+++ b/leo_errors/errors/index.html
@@ -1,4 +1,4 @@
-leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo lang.
+leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo language.
Re-exports§
pub use self::ast::*;
pub use self::cli::*;
pub use self::compiler::*;
pub use self::flattener::*;
pub use self::loop_unroller::*;
pub use self::package::*;
pub use self::parser::*;
pub use self::type_checker::*;
pub use self::utils::*;
Modules§
- Contains the AST error definitions.
- Contains the CLI error definitions.
- Contains the Compiler error definitions.
- Contains the Flattener error definitions.
- Contains the Loop Unroller error definitions.
- Contains the Package error definitions.
- Contains the Parser error definitions.
- Contains the Type Checker error definitions.
- Contains the Utils error definitions.
Enums§
- The LeoError type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
- The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
+This allows a unified error type throughout the Leo crates.The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates. Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
diff --git a/leo_errors/index.html b/leo_errors/index.html
index da14ceb37f..5bbc7ccfbb 100644
--- a/leo_errors/index.html
+++ b/leo_errors/index.html
@@ -46,6 +46,6 @@ §SnarkVM
When SnarkVM implements better error codes and messages, we can bubble them up.
§Utils
The errors related to dependency retrieval in the utils
crate. Its error codes will range from 10_000-10_999 and be prefixed with the characters DEP
.
-
Re-exports§
Modules§
- Contains the common functionalities for defining errors..
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo lang.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
+
Re-exports§
Modules§
- Contains the common functionalities for defining errors.
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo language.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
and error methods generated through a DSL creates and generates errors
with a unique error code.
\ No newline at end of file
diff --git a/leo_package/build/directory/struct.BuildDirectory.html b/leo_package/build/directory/struct.BuildDirectory.html
index fac07569cb..3398708872 100644
--- a/leo_package/build/directory/struct.BuildDirectory.html
+++ b/leo_package/build/directory/struct.BuildDirectory.html
@@ -1,6 +1,6 @@
-BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
source§impl BuildDirectory
sourcepub fn open(path: &Path) -> Result<PathBuf>
Returns the path to the build directory if it exists.
-sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for BuildDirectory
§impl RefUnwindSafe for BuildDirectory
§impl Send for BuildDirectory
§impl Sync for BuildDirectory
§impl Unpin for BuildDirectory
§impl UnwindSafe for BuildDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/fn.parse_file_paths.html b/leo_package/fn.parse_file_paths.html
index 5e8c86b57f..32c80a43ae 100644
--- a/leo_package/fn.parse_file_paths.html
+++ b/leo_package/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package - Rust Function leo_package::parse_file_paths
source · pub(crate) fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/imports/directory/struct.ImportsDirectory.html b/leo_package/imports/directory/struct.ImportsDirectory.html
index f58c759e92..9885ee13dd 100644
--- a/leo_package/imports/directory/struct.ImportsDirectory.html
+++ b/leo_package/imports/directory/struct.ImportsDirectory.html
@@ -1,7 +1,7 @@
-ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name if it does not exist.
-sourcepub fn is_empty(path: &Path) -> Result<bool>
Returns true if the imports directory does not exist or does not contain files.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the imports directory.
+ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
Auto Trait Implementations§
§impl Freeze for ImportsDirectory
§impl RefUnwindSafe for ImportsDirectory
§impl Send for ImportsDirectory
§impl Sync for ImportsDirectory
§impl Unpin for ImportsDirectory
§impl UnwindSafe for ImportsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/inputs/directory/fn.parse_file_paths.html b/leo_package/inputs/directory/fn.parse_file_paths.html
index 1b5a58356c..bbc13fb6c2 100644
--- a/leo_package/inputs/directory/fn.parse_file_paths.html
+++ b/leo_package/inputs/directory/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package::inputs::directory - Rust Function leo_package::inputs::directory::parse_file_paths
source · fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/inputs/directory/struct.InputsDirectory.html b/leo_package/inputs/directory/struct.InputsDirectory.html
index 3be222239e..42e6487029 100644
--- a/leo_package/inputs/directory/struct.InputsDirectory.html
+++ b/leo_package/inputs/directory/struct.InputsDirectory.html
@@ -1,5 +1,5 @@
-InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
source§impl InputsDirectory
sourcepub fn create(path: &Path) -> Result<()>
Creates a directory at the provided path with the default directory name.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the input directory.
+InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for InputsDirectory
§impl RefUnwindSafe for InputsDirectory
§impl Send for InputsDirectory
§impl Sync for InputsDirectory
§impl Unpin for InputsDirectory
§impl UnwindSafe for InputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
index cb29b629d0..fd1493e673 100644
--- a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
+++ b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
@@ -3,8 +3,8 @@
pub snapshot: Snapshot,
}Expand description
Generic Snapshot file wrapper. Each package can have up to 3
different snapshots: initial_ast, canonicalization_ast and type_inferenced_ast;
-Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+
Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn snapshot_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for SnapshotFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for SnapshotFile
§impl RefUnwindSafe for SnapshotFile
§impl Send for SnapshotFile
§impl Sync for SnapshotFile
§impl Unpin for SnapshotFile
§impl UnwindSafe for SnapshotFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/checksum/struct.ChecksumFile.html b/leo_package/outputs/checksum/struct.ChecksumFile.html
index def0ba7fb2..a83b3f87ce 100644
--- a/leo_package/outputs/checksum/struct.ChecksumFile.html
+++ b/leo_package/outputs/checksum/struct.ChecksumFile.html
@@ -1,8 +1,8 @@
ChecksumFile in leo_package::outputs::checksum - Rust Struct leo_package::outputs::checksum::ChecksumFile
source · pub struct ChecksumFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for ChecksumFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ChecksumFile
§impl RefUnwindSafe for ChecksumFile
§impl Send for ChecksumFile
§impl Sync for ChecksumFile
§impl Unpin for ChecksumFile
§impl UnwindSafe for ChecksumFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/circuit/struct.CircuitFile.html b/leo_package/outputs/circuit/struct.CircuitFile.html
index 7a313cccc5..2016ebb713 100644
--- a/leo_package/outputs/circuit/struct.CircuitFile.html
+++ b/leo_package/outputs/circuit/struct.CircuitFile.html
@@ -1,8 +1,8 @@
CircuitFile in leo_package::outputs::circuit - Rust Struct leo_package::outputs::circuit::CircuitFile
source · pub struct CircuitFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for CircuitFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for CircuitFile
§impl RefUnwindSafe for CircuitFile
§impl Send for CircuitFile
§impl Sync for CircuitFile
§impl Unpin for CircuitFile
§impl UnwindSafe for CircuitFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/directory/struct.OutputsDirectory.html b/leo_package/outputs/directory/struct.OutputsDirectory.html
index e6c87e2ceb..eed4aadfb3 100644
--- a/leo_package/outputs/directory/struct.OutputsDirectory.html
+++ b/leo_package/outputs/directory/struct.OutputsDirectory.html
@@ -1,5 +1,5 @@
-OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
source§impl OutputsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for OutputsDirectory
§impl RefUnwindSafe for OutputsDirectory
§impl Send for OutputsDirectory
§impl Sync for OutputsDirectory
§impl Unpin for OutputsDirectory
§impl UnwindSafe for OutputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/package/struct.Package.html b/leo_package/package/struct.Package.html
index 5ddc7ad345..a169387912 100644
--- a/leo_package/package/struct.Package.html
+++ b/leo_package/package/struct.Package.html
@@ -3,8 +3,8 @@
pub version: String,
pub description: Option<String>,
pub license: Option<String>,
- pub network: NetworkName,
-}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
+ pub network: NetworkName,
+}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
Aleo names can only contain ASCII alphanumeric characters and underscores.
sourcepub fn can_initialize(package_name: &str, path: &Path) -> bool
Returns true
if a package is can be initialized at a given path.
impl<T> Any for Twhere
diff --git a/leo_compiler/compiler/struct.Compiler.html b/leo_compiler/compiler/struct.Compiler.html
index 3d7910794c..fc6adb7839 100644
--- a/leo_compiler/compiler/struct.Compiler.html
+++ b/leo_compiler/compiler/struct.Compiler.html
@@ -1,5 +1,5 @@
Compiler in leo_compiler::compiler - Rust Struct leo_compiler::compiler::Compiler
source · pub struct Compiler<'a, N: Network> {
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
pub program_name: String,
@@ -9,10 +9,10 @@
node_builder: NodeBuilder,
assigner: Assigner,
type_table: TypeTable,
- import_stubs: IndexMap<Symbol, Stub>,
+ import_stubs: IndexMap<Symbol, Stub>,
phantom: PhantomData<N>,
}
Expand description
The primary entry point of the Leo compiler.
-Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
+Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
§main_file_path: PathBuf
The path to the main leo file.
§output_directory: PathBuf
The path to where the compiler outputs all generated files.
§program_name: String
The program name,
@@ -22,57 +22,57 @@
§node_builder: NodeBuilder
The NodeCounter
used to generate sequentially increasing NodeID
s.
§assigner: Assigner
The Assigner
is used to construct (unique) assignment statements.
§type_table: TypeTable
The type table.
-§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
+§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
§phantom: PhantomData<N>
Implementations§
source§impl<'a, N: Network> Compiler<'a, N>
sourcepub fn new(
program_name: String,
network: String,
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
compiler_options: Option<CompilerOptions>,
- import_stubs: IndexMap<Symbol, Stub>
+ import_stubs: IndexMap<Symbol, Stub>
) -> Self
Returns a new Leo compiler.
-sourcepub fn parse_program_from_string(
&mut self,
program_string: &str,
- name: FileName
-) -> Result<()>
Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
-sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
-sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
+ name: FileName
+) -> Result<()>Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
+sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
+sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
sourcepub fn type_checker_pass(
&'a self,
symbol_table: SymbolTable
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the type checker pass.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the type checker pass.
sourcepub fn loop_unrolling_pass(
&mut self,
symbol_table: SymbolTable
-) -> Result<SymbolTable>
Runs the loop unrolling pass.
+) -> Result<SymbolTable>Runs the loop unrolling pass.
sourcepub fn static_single_assignment_pass(
&mut self,
symbol_table: &SymbolTable
-) -> Result<()>
Runs the static single assignment pass.
-sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
-sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
-sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
-sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
+) -> Result<()>Runs the static single assignment pass.
+sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
+sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
+sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
+sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
sourcepub fn code_generation_pass(
&mut self,
symbol_table: &SymbolTable,
struct_graph: &StructGraph,
call_graph: &CallGraph
-) -> Result<String>
Runs the code generation pass.
+) -> Result<String>Runs the code generation pass.
sourcepub fn compiler_stages(
&mut self
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the compiler stages.
-sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the compiler stages.
+sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
sourcefn write_symbol_table_to_json(
&self,
file_suffix: &str,
symbol_table: &SymbolTable
-) -> Result<()>
Writes the Symbol Table to a JSON file.
-sourcepub fn add_import_stubs(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
§impl<'a, N> !Freeze for Compiler<'a, N>
§impl<'a, N> !RefUnwindSafe for Compiler<'a, N>
§impl<'a, N> !Send for Compiler<'a, N>
§impl<'a, N> !Sync for Compiler<'a, N>
§impl<'a, N> Unpin for Compiler<'a, N>where
N: Unpin,
§impl<'a, N> !UnwindSafe for Compiler<'a, N>
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_compiler/compiler/struct.SymbolTable.html b/leo_compiler/compiler/struct.SymbolTable.html
index dc00879288..7e990f1dc1 100644
--- a/leo_compiler/compiler/struct.SymbolTable.html
+++ b/leo_compiler/compiler/struct.SymbolTable.html
@@ -13,8 +13,8 @@
&self,
location: &Location,
is_struct: bool,
- span: Span
-) -> Result<(), LeoError>Recursively checks if the symbol table contains an entry for the given symbol.
+ span: Span
+) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol.
Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
Returns the current scope index.
Increments the scope index.
@@ -22,35 +22,35 @@
&mut self,
location: Location,
insert: &Function
-) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
-sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SymbolTable
source§impl Default for SymbolTable
source§fn default() -> SymbolTable
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_compiler/struct.Ast.html b/leo_compiler/struct.Ast.html
index ad68be994a..1e6b1d6afa 100644
--- a/leo_compiler/struct.Ast.html
+++ b/leo_compiler/struct.Ast.html
@@ -5,20 +5,20 @@
These data types form a tree that begins from a Program
type root.
Fields§
§ast: Program
Implementations§
source§impl Ast
sourcepub fn as_repr(&self) -> &Program
Returns a reference to the inner program AST representation.
-sourcepub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
+
sourcepub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
Serializes the ast into a JSON file.
+) -> Result<(), LeoError>Serializes the ast into a JSON file.
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<Ast, LeoError>
Deserializes the JSON string into a ast.
-sourcepub fn from_json_file(path: PathBuf) -> Result<Ast, LeoError>
Trait Implementations§
source§impl Eq for Ast
source§impl StructuralPartialEq for Ast
Auto Trait Implementations§
§impl Freeze for Ast
§impl !RefUnwindSafe for Ast
§impl Send for Ast
§impl !Sync for Ast
§impl Unpin for Ast
§impl UnwindSafe for Ast
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_compiler/struct.Compiler.html b/leo_compiler/struct.Compiler.html
index 3b92156fca..753a369be0 100644
--- a/leo_compiler/struct.Compiler.html
+++ b/leo_compiler/struct.Compiler.html
@@ -1,5 +1,5 @@
Compiler in leo_compiler - Rust Struct leo_compiler::Compiler
source · pub struct Compiler<'a, N: Network> {
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
pub program_name: String,
@@ -9,10 +9,10 @@
node_builder: NodeBuilder,
assigner: Assigner,
type_table: TypeTable,
- import_stubs: IndexMap<Symbol, Stub>,
+ import_stubs: IndexMap<Symbol, Stub>,
phantom: PhantomData<N>,
}
Expand description
The primary entry point of the Leo compiler.
-Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
+Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
§main_file_path: PathBuf
The path to the main leo file.
§output_directory: PathBuf
The path to where the compiler outputs all generated files.
§program_name: String
The program name,
@@ -22,57 +22,57 @@
§node_builder: NodeBuilder
The NodeCounter
used to generate sequentially increasing NodeID
s.
§assigner: Assigner
The Assigner
is used to construct (unique) assignment statements.
§type_table: TypeTable
The type table.
-§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
+§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
§phantom: PhantomData<N>
Implementations§
source§impl<'a, N: Network> Compiler<'a, N>
sourcepub fn new(
program_name: String,
network: String,
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
compiler_options: Option<CompilerOptions>,
- import_stubs: IndexMap<Symbol, Stub>
+ import_stubs: IndexMap<Symbol, Stub>
) -> Self
Returns a new Leo compiler.
-sourcepub fn parse_program_from_string(
&mut self,
program_string: &str,
- name: FileName
-) -> Result<()>
Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
-sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
-sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
+ name: FileName
+) -> Result<()>Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
+sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
+sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
sourcepub fn type_checker_pass(
&'a self,
symbol_table: SymbolTable
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the type checker pass.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the type checker pass.
sourcepub fn loop_unrolling_pass(
&mut self,
symbol_table: SymbolTable
-) -> Result<SymbolTable>
Runs the loop unrolling pass.
+) -> Result<SymbolTable>Runs the loop unrolling pass.
sourcepub fn static_single_assignment_pass(
&mut self,
symbol_table: &SymbolTable
-) -> Result<()>
Runs the static single assignment pass.
-sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
-sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
-sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
-sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
+) -> Result<()>Runs the static single assignment pass.
+sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
+sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
+sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
+sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
sourcepub fn code_generation_pass(
&mut self,
symbol_table: &SymbolTable,
struct_graph: &StructGraph,
call_graph: &CallGraph
-) -> Result<String>
Runs the code generation pass.
+) -> Result<String>Runs the code generation pass.
sourcepub fn compiler_stages(
&mut self
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the compiler stages.
-sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the compiler stages.
+sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
sourcefn write_symbol_table_to_json(
&self,
file_suffix: &str,
symbol_table: &SymbolTable
-) -> Result<()>
Writes the Symbol Table to a JSON file.
-sourcepub fn add_import_stubs(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
§impl<'a, N> !Freeze for Compiler<'a, N>
§impl<'a, N> !RefUnwindSafe for Compiler<'a, N>
§impl<'a, N> !Send for Compiler<'a, N>
§impl<'a, N> !Sync for Compiler<'a, N>
§impl<'a, N> Unpin for Compiler<'a, N>where
N: Unpin,
§impl<'a, N> !UnwindSafe for Compiler<'a, N>
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_compiler/struct.SymbolTable.html b/leo_compiler/struct.SymbolTable.html
index abd12cc7c0..cf23f3f321 100644
--- a/leo_compiler/struct.SymbolTable.html
+++ b/leo_compiler/struct.SymbolTable.html
@@ -13,8 +13,8 @@
&self,
location: &Location,
is_struct: bool,
- span: Span
-) -> Result<(), LeoError>Recursively checks if the symbol table contains an entry for the given symbol.
+ span: Span
+) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol.
Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
Returns the current scope index.
Increments the scope index.
@@ -22,35 +22,35 @@
&mut self,
location: Location,
insert: &Function
-) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
-sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SymbolTable
source§impl Default for SymbolTable
source§fn default() -> SymbolTable
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_disassembler/fn.disassemble_from_str.html b/leo_disassembler/fn.disassemble_from_str.html
index 0dc23c5ffd..73dd2bcdf6 100644
--- a/leo_disassembler/fn.disassemble_from_str.html
+++ b/leo_disassembler/fn.disassemble_from_str.html
@@ -1,4 +1,4 @@
disassemble_from_str in leo_disassembler - Rust Function leo_disassembler::disassemble_from_str
source · pub fn disassemble_from_str<N: Network>(
name: &str,
program: &str
-) -> Result<Stub, UtilError>
\ No newline at end of file
+) -> Result<Stub, UtilError>
\ No newline at end of file
diff --git a/leo_errors/common/index.html b/leo_errors/common/index.html
index 9823564797..7349584cbe 100644
--- a/leo_errors/common/index.html
+++ b/leo_errors/common/index.html
@@ -1,2 +1,2 @@
-leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors..
+leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors.
Re-exports§
pub use self::backtraced::*;
pub use self::formatted::*;
pub use self::traits::*;
Modules§
- This module contains a backtraced error and its methods.
- This module contains a formatted error and its methods.
- This module contains the macros for making errors easily.
- This module contains traits for making errors easily.
\ No newline at end of file
diff --git a/leo_errors/errors/enum.LeoError.html b/leo_errors/errors/enum.LeoError.html
index 14a74cc5b9..8ec7a32fc3 100644
--- a/leo_errors/errors/enum.LeoError.html
+++ b/leo_errors/errors/enum.LeoError.html
@@ -13,16 +13,16 @@
}Expand description
The LeoError type that contains all sub error types.
This allows a unified error type throughout the Leo crates.
Variants§
§AstError(AstError)
Represents an AST Error in a Leo Error.
-§CliError(CliError)
Represents an CLI Error in a Leo Error.
-§CompilerError(CompilerError)
Represents an Compiler Error in a Leo Error.
-§PackageError(PackageError)
Represents an Package Error in a Leo Error.
-§ParserError(ParserError)
Represents an Parser Error in a Leo Error.
+§CliError(CliError)
Represents a CLI Error in a Leo Error.
+§CompilerError(CompilerError)
Represents a Compiler Error in a Leo Error.
+§PackageError(PackageError)
Represents a Package Error in a Leo Error.
+§ParserError(ParserError)
Represents a Parser Error in a Leo Error.
§TypeCheckerError(TypeCheckerError)
Represents a Type Checker Error in a Leo Error.
§LoopUnrollerError(LoopUnrollerError)
Represents a Loop Unroller Error in a Leo Error.
§FlattenError(FlattenError)
Represents a Flatten Error in a Leo Error.
§LastErrorCode(i32)
Purely for just exiting with the correct status code and
not re-displaying an error.
-§UtilError(UtilError)
Represents a Utils Error in a Leo Error
+§UtilError(UtilError)
Represents a Utils Error in a Leo Error.
§Anyhow(Error)
Anyhow errors.
Implementations§
source§impl LeoError
sourcepub fn error_code(&self) -> String
Implement error code for each type of Error.
sourcepub fn exit_code(&self) -> i32
Implement exit code for each type of Error.
diff --git a/leo_errors/errors/enum.LeoWarning.html b/leo_errors/errors/enum.LeoWarning.html
index 0faa5539be..c1588d6821 100644
--- a/leo_errors/errors/enum.LeoWarning.html
+++ b/leo_errors/errors/enum.LeoWarning.html
@@ -1,10 +1,10 @@
-LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
+LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
ParserWarning(ParserWarning),
TypeCheckerWarning(TypeCheckerWarning),
-}
Expand description
The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
-Variants§
§ParserWarning(ParserWarning)
Represents an Parser Error in a Leo Error.
-§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Error in a Leo Error.
+}Expand description
The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates.
+Variants§
§ParserWarning(ParserWarning)
Represents an Parser Warning in a Leo Warning.
+§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Warning in a Leo Warning.
Implementations§
source§impl LeoWarning
sourcepub fn error_code(&self) -> String
Implement warning code for each type of Warning.
Trait Implementations§
source§impl Debug for LeoWarning
source§impl Display for LeoWarning
source§impl Error for LeoWarning
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<ParserWarning> for LeoWarning
source§fn from(source: ParserWarning) -> Self
Converts to this type from the input type.source§impl From<TypeCheckerWarning> for LeoWarning
source§fn from(source: TypeCheckerWarning) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for LeoWarning
§impl RefUnwindSafe for LeoWarning
§impl Send for LeoWarning
§impl Sync for LeoWarning
§impl Unpin for LeoWarning
§impl UnwindSafe for LeoWarning
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_errors/errors/index.html b/leo_errors/errors/index.html
index a9aaa3418b..257932bad3 100644
--- a/leo_errors/errors/index.html
+++ b/leo_errors/errors/index.html
@@ -1,4 +1,4 @@
-leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo lang.
+leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo language.
Re-exports§
pub use self::ast::*;
pub use self::cli::*;
pub use self::compiler::*;
pub use self::flattener::*;
pub use self::loop_unroller::*;
pub use self::package::*;
pub use self::parser::*;
pub use self::type_checker::*;
pub use self::utils::*;
Modules§
- Contains the AST error definitions.
- Contains the CLI error definitions.
- Contains the Compiler error definitions.
- Contains the Flattener error definitions.
- Contains the Loop Unroller error definitions.
- Contains the Package error definitions.
- Contains the Parser error definitions.
- Contains the Type Checker error definitions.
- Contains the Utils error definitions.
Enums§
- The LeoError type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
- The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
+This allows a unified error type throughout the Leo crates.The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates. Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
diff --git a/leo_errors/index.html b/leo_errors/index.html
index da14ceb37f..5bbc7ccfbb 100644
--- a/leo_errors/index.html
+++ b/leo_errors/index.html
@@ -46,6 +46,6 @@ §SnarkVM
When SnarkVM implements better error codes and messages, we can bubble them up.
§Utils
The errors related to dependency retrieval in the utils
crate. Its error codes will range from 10_000-10_999 and be prefixed with the characters DEP
.
-
Re-exports§
Modules§
- Contains the common functionalities for defining errors..
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo lang.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
+
Re-exports§
Modules§
- Contains the common functionalities for defining errors.
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo language.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
and error methods generated through a DSL creates and generates errors
with a unique error code.
\ No newline at end of file
diff --git a/leo_package/build/directory/struct.BuildDirectory.html b/leo_package/build/directory/struct.BuildDirectory.html
index fac07569cb..3398708872 100644
--- a/leo_package/build/directory/struct.BuildDirectory.html
+++ b/leo_package/build/directory/struct.BuildDirectory.html
@@ -1,6 +1,6 @@
-BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
source§impl BuildDirectory
sourcepub fn open(path: &Path) -> Result<PathBuf>
Returns the path to the build directory if it exists.
-sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for BuildDirectory
§impl RefUnwindSafe for BuildDirectory
§impl Send for BuildDirectory
§impl Sync for BuildDirectory
§impl Unpin for BuildDirectory
§impl UnwindSafe for BuildDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/fn.parse_file_paths.html b/leo_package/fn.parse_file_paths.html
index 5e8c86b57f..32c80a43ae 100644
--- a/leo_package/fn.parse_file_paths.html
+++ b/leo_package/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package - Rust Function leo_package::parse_file_paths
source · pub(crate) fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/imports/directory/struct.ImportsDirectory.html b/leo_package/imports/directory/struct.ImportsDirectory.html
index f58c759e92..9885ee13dd 100644
--- a/leo_package/imports/directory/struct.ImportsDirectory.html
+++ b/leo_package/imports/directory/struct.ImportsDirectory.html
@@ -1,7 +1,7 @@
-ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name if it does not exist.
-sourcepub fn is_empty(path: &Path) -> Result<bool>
Returns true if the imports directory does not exist or does not contain files.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the imports directory.
+ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
Auto Trait Implementations§
§impl Freeze for ImportsDirectory
§impl RefUnwindSafe for ImportsDirectory
§impl Send for ImportsDirectory
§impl Sync for ImportsDirectory
§impl Unpin for ImportsDirectory
§impl UnwindSafe for ImportsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/inputs/directory/fn.parse_file_paths.html b/leo_package/inputs/directory/fn.parse_file_paths.html
index 1b5a58356c..bbc13fb6c2 100644
--- a/leo_package/inputs/directory/fn.parse_file_paths.html
+++ b/leo_package/inputs/directory/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package::inputs::directory - Rust Function leo_package::inputs::directory::parse_file_paths
source · fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/inputs/directory/struct.InputsDirectory.html b/leo_package/inputs/directory/struct.InputsDirectory.html
index 3be222239e..42e6487029 100644
--- a/leo_package/inputs/directory/struct.InputsDirectory.html
+++ b/leo_package/inputs/directory/struct.InputsDirectory.html
@@ -1,5 +1,5 @@
-InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
source§impl InputsDirectory
sourcepub fn create(path: &Path) -> Result<()>
Creates a directory at the provided path with the default directory name.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the input directory.
+InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for InputsDirectory
§impl RefUnwindSafe for InputsDirectory
§impl Send for InputsDirectory
§impl Sync for InputsDirectory
§impl Unpin for InputsDirectory
§impl UnwindSafe for InputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
index cb29b629d0..fd1493e673 100644
--- a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
+++ b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
@@ -3,8 +3,8 @@
pub snapshot: Snapshot,
}Expand description
Generic Snapshot file wrapper. Each package can have up to 3
different snapshots: initial_ast, canonicalization_ast and type_inferenced_ast;
-Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+
Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn snapshot_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for SnapshotFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for SnapshotFile
§impl RefUnwindSafe for SnapshotFile
§impl Send for SnapshotFile
§impl Sync for SnapshotFile
§impl Unpin for SnapshotFile
§impl UnwindSafe for SnapshotFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/checksum/struct.ChecksumFile.html b/leo_package/outputs/checksum/struct.ChecksumFile.html
index def0ba7fb2..a83b3f87ce 100644
--- a/leo_package/outputs/checksum/struct.ChecksumFile.html
+++ b/leo_package/outputs/checksum/struct.ChecksumFile.html
@@ -1,8 +1,8 @@
ChecksumFile in leo_package::outputs::checksum - Rust Struct leo_package::outputs::checksum::ChecksumFile
source · pub struct ChecksumFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for ChecksumFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ChecksumFile
§impl RefUnwindSafe for ChecksumFile
§impl Send for ChecksumFile
§impl Sync for ChecksumFile
§impl Unpin for ChecksumFile
§impl UnwindSafe for ChecksumFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/circuit/struct.CircuitFile.html b/leo_package/outputs/circuit/struct.CircuitFile.html
index 7a313cccc5..2016ebb713 100644
--- a/leo_package/outputs/circuit/struct.CircuitFile.html
+++ b/leo_package/outputs/circuit/struct.CircuitFile.html
@@ -1,8 +1,8 @@
CircuitFile in leo_package::outputs::circuit - Rust Struct leo_package::outputs::circuit::CircuitFile
source · pub struct CircuitFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for CircuitFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for CircuitFile
§impl RefUnwindSafe for CircuitFile
§impl Send for CircuitFile
§impl Sync for CircuitFile
§impl Unpin for CircuitFile
§impl UnwindSafe for CircuitFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/directory/struct.OutputsDirectory.html b/leo_package/outputs/directory/struct.OutputsDirectory.html
index e6c87e2ceb..eed4aadfb3 100644
--- a/leo_package/outputs/directory/struct.OutputsDirectory.html
+++ b/leo_package/outputs/directory/struct.OutputsDirectory.html
@@ -1,5 +1,5 @@
-OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
source§impl OutputsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for OutputsDirectory
§impl RefUnwindSafe for OutputsDirectory
§impl Send for OutputsDirectory
§impl Sync for OutputsDirectory
§impl Unpin for OutputsDirectory
§impl UnwindSafe for OutputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/package/struct.Package.html b/leo_package/package/struct.Package.html
index 5ddc7ad345..a169387912 100644
--- a/leo_package/package/struct.Package.html
+++ b/leo_package/package/struct.Package.html
@@ -3,8 +3,8 @@
pub version: String,
pub description: Option<String>,
pub license: Option<String>,
- pub network: NetworkName,
-}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
+ pub network: NetworkName,
+}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
Aleo names can only contain ASCII alphanumeric characters and underscores.
sourcepub fn can_initialize(package_name: &str, path: &Path) -> bool
Returns true
if a package is can be initialized at a given path.
Struct leo_compiler::compiler::Compiler
source · pub struct Compiler<'a, N: Network> {
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
pub program_name: String,
@@ -9,10 +9,10 @@
node_builder: NodeBuilder,
assigner: Assigner,
type_table: TypeTable,
- import_stubs: IndexMap<Symbol, Stub>,
+ import_stubs: IndexMap<Symbol, Stub>,
phantom: PhantomData<N>,
}
Expand description
The primary entry point of the Leo compiler.
-Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
+Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
main_file_path: PathBuf
The path to the main leo file.
output_directory: PathBuf
The path to where the compiler outputs all generated files.
program_name: String
The program name,
@@ -22,57 +22,57 @@node_builder: NodeBuilder
The NodeCounter
used to generate sequentially increasing NodeID
s.
assigner: Assigner
The Assigner
is used to construct (unique) assignment statements.
type_table: TypeTable
The type table.
-import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
phantom: PhantomData<N>
Implementations§
source§impl<'a, N: Network> Compiler<'a, N>
impl<'a, N: Network> Compiler<'a, N>
sourcepub fn new(
program_name: String,
network: String,
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
compiler_options: Option<CompilerOptions>,
- import_stubs: IndexMap<Symbol, Stub>
+ import_stubs: IndexMap<Symbol, Stub>
) -> Self
pub fn new( program_name: String, network: String, - handler: &'a Handler, + handler: &'a Handler, main_file_path: PathBuf, output_directory: PathBuf, compiler_options: Option<CompilerOptions>, - import_stubs: IndexMap<Symbol, Stub> + import_stubs: IndexMap<Symbol, Stub> ) -> Self
Returns a new Leo compiler.
-sourcepub fn parse_program_from_string(
&mut self,
program_string: &str,
- name: FileName
-) -> Result<()>
pub fn parse_program_from_string( &mut self, program_string: &str, - name: FileName -) -> Result<()>
Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
-sourcepub fn parse_program(&mut self) -> Result<()>
pub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
-sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
pub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
+ name: FileName +) -> Result<()>Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
+sourcepub fn parse_program(&mut self) -> Result<()>
pub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
+sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
pub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
sourcepub fn type_checker_pass(
&'a self,
symbol_table: SymbolTable
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
pub fn type_checker_pass( &'a self, symbol_table: SymbolTable -) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the type checker pass.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the type checker pass.
sourcepub fn loop_unrolling_pass(
&mut self,
symbol_table: SymbolTable
-) -> Result<SymbolTable>
pub fn loop_unrolling_pass( &mut self, symbol_table: SymbolTable -) -> Result<SymbolTable>
Runs the loop unrolling pass.
+) -> Result<SymbolTable>Runs the loop unrolling pass.
sourcepub fn static_single_assignment_pass(
&mut self,
symbol_table: &SymbolTable
-) -> Result<()>
pub fn static_single_assignment_pass( &mut self, symbol_table: &SymbolTable -) -> Result<()>
Runs the static single assignment pass.
-sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
pub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
-sourcepub fn destructuring_pass(&mut self) -> Result<()>
pub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
-sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
pub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
-sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
pub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
+) -> Result<()>Runs the static single assignment pass.
+sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
pub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
+sourcepub fn destructuring_pass(&mut self) -> Result<()>
pub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
+sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
pub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
+sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
pub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
sourcepub fn code_generation_pass(
&mut self,
symbol_table: &SymbolTable,
struct_graph: &StructGraph,
call_graph: &CallGraph
-) -> Result<String>
pub fn code_generation_pass( &mut self, symbol_table: &SymbolTable, struct_graph: &StructGraph, call_graph: &CallGraph -) -> Result<String>
Runs the code generation pass.
+) -> Result<String>Runs the code generation pass.
sourcepub fn compiler_stages(
&mut self
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
pub fn compiler_stages( &mut self -) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the compiler stages.
-sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
fn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the compiler stages.
+sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
fn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
sourcefn write_symbol_table_to_json(
&self,
file_suffix: &str,
symbol_table: &SymbolTable
-) -> Result<()>
fn write_symbol_table_to_json( &self, file_suffix: &str, symbol_table: &SymbolTable -) -> Result<()>
Writes the Symbol Table to a JSON file.
-sourcepub fn add_import_stubs(&mut self) -> Result<()>
pub fn add_import_stubs(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl<'a, N> !Freeze for Compiler<'a, N>
impl<'a, N> !RefUnwindSafe for Compiler<'a, N>
impl<'a, N> !Send for Compiler<'a, N>
impl<'a, N> !Sync for Compiler<'a, N>
impl<'a, N> Unpin for Compiler<'a, N>where
N: Unpin,
impl<'a, N> !UnwindSafe for Compiler<'a, N>
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_compiler/compiler/struct.SymbolTable.html b/leo_compiler/compiler/struct.SymbolTable.html
index dc00879288..7e990f1dc1 100644
--- a/leo_compiler/compiler/struct.SymbolTable.html
+++ b/leo_compiler/compiler/struct.SymbolTable.html
@@ -13,8 +13,8 @@
&self,
location: &Location,
is_struct: bool,
- span: Span
-) -> Result<(), LeoError>Recursively checks if the symbol table contains an entry for the given symbol.
+ span: Span
+) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol.
Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
Returns the current scope index.
Increments the scope index.
@@ -22,35 +22,35 @@
&mut self,
location: Location,
insert: &Function
-) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
-sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SymbolTable
source§impl Default for SymbolTable
source§fn default() -> SymbolTable
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_compiler/struct.Ast.html b/leo_compiler/struct.Ast.html
index ad68be994a..1e6b1d6afa 100644
--- a/leo_compiler/struct.Ast.html
+++ b/leo_compiler/struct.Ast.html
@@ -5,20 +5,20 @@
These data types form a tree that begins from a Program
type root.
Fields§
§ast: Program
Implementations§
source§impl Ast
sourcepub fn as_repr(&self) -> &Program
Returns a reference to the inner program AST representation.
-sourcepub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
+
sourcepub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
Serializes the ast into a JSON file.
+) -> Result<(), LeoError>Serializes the ast into a JSON file.
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<Ast, LeoError>
Deserializes the JSON string into a ast.
-sourcepub fn from_json_file(path: PathBuf) -> Result<Ast, LeoError>
Trait Implementations§
source§impl Eq for Ast
source§impl StructuralPartialEq for Ast
Auto Trait Implementations§
§impl Freeze for Ast
§impl !RefUnwindSafe for Ast
§impl Send for Ast
§impl !Sync for Ast
§impl Unpin for Ast
§impl UnwindSafe for Ast
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_compiler/struct.Compiler.html b/leo_compiler/struct.Compiler.html
index 3b92156fca..753a369be0 100644
--- a/leo_compiler/struct.Compiler.html
+++ b/leo_compiler/struct.Compiler.html
@@ -1,5 +1,5 @@
Compiler in leo_compiler - Rust Struct leo_compiler::Compiler
source · pub struct Compiler<'a, N: Network> {
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
pub program_name: String,
@@ -9,10 +9,10 @@
node_builder: NodeBuilder,
assigner: Assigner,
type_table: TypeTable,
- import_stubs: IndexMap<Symbol, Stub>,
+ import_stubs: IndexMap<Symbol, Stub>,
phantom: PhantomData<N>,
}
Expand description
The primary entry point of the Leo compiler.
-Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
+Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
§main_file_path: PathBuf
The path to the main leo file.
§output_directory: PathBuf
The path to where the compiler outputs all generated files.
§program_name: String
The program name,
@@ -22,57 +22,57 @@
§node_builder: NodeBuilder
The NodeCounter
used to generate sequentially increasing NodeID
s.
§assigner: Assigner
The Assigner
is used to construct (unique) assignment statements.
§type_table: TypeTable
The type table.
-§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
+§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
§phantom: PhantomData<N>
Implementations§
source§impl<'a, N: Network> Compiler<'a, N>
sourcepub fn new(
program_name: String,
network: String,
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
compiler_options: Option<CompilerOptions>,
- import_stubs: IndexMap<Symbol, Stub>
+ import_stubs: IndexMap<Symbol, Stub>
) -> Self
Returns a new Leo compiler.
-sourcepub fn parse_program_from_string(
&mut self,
program_string: &str,
- name: FileName
-) -> Result<()>
Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
-sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
-sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
+ name: FileName
+) -> Result<()>Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
+sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
+sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
sourcepub fn type_checker_pass(
&'a self,
symbol_table: SymbolTable
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the type checker pass.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the type checker pass.
sourcepub fn loop_unrolling_pass(
&mut self,
symbol_table: SymbolTable
-) -> Result<SymbolTable>
Runs the loop unrolling pass.
+) -> Result<SymbolTable>Runs the loop unrolling pass.
sourcepub fn static_single_assignment_pass(
&mut self,
symbol_table: &SymbolTable
-) -> Result<()>
Runs the static single assignment pass.
-sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
-sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
-sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
-sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
+) -> Result<()>Runs the static single assignment pass.
+sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
+sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
+sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
+sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
sourcepub fn code_generation_pass(
&mut self,
symbol_table: &SymbolTable,
struct_graph: &StructGraph,
call_graph: &CallGraph
-) -> Result<String>
Runs the code generation pass.
+) -> Result<String>Runs the code generation pass.
sourcepub fn compiler_stages(
&mut self
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the compiler stages.
-sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the compiler stages.
+sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
sourcefn write_symbol_table_to_json(
&self,
file_suffix: &str,
symbol_table: &SymbolTable
-) -> Result<()>
Writes the Symbol Table to a JSON file.
-sourcepub fn add_import_stubs(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
§impl<'a, N> !Freeze for Compiler<'a, N>
§impl<'a, N> !RefUnwindSafe for Compiler<'a, N>
§impl<'a, N> !Send for Compiler<'a, N>
§impl<'a, N> !Sync for Compiler<'a, N>
§impl<'a, N> Unpin for Compiler<'a, N>where
N: Unpin,
§impl<'a, N> !UnwindSafe for Compiler<'a, N>
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_compiler/struct.SymbolTable.html b/leo_compiler/struct.SymbolTable.html
index abd12cc7c0..cf23f3f321 100644
--- a/leo_compiler/struct.SymbolTable.html
+++ b/leo_compiler/struct.SymbolTable.html
@@ -13,8 +13,8 @@
&self,
location: &Location,
is_struct: bool,
- span: Span
-) -> Result<(), LeoError>Recursively checks if the symbol table contains an entry for the given symbol.
+ span: Span
+) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol.
Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
Returns the current scope index.
Increments the scope index.
@@ -22,35 +22,35 @@
&mut self,
location: Location,
insert: &Function
-) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
-sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SymbolTable
source§impl Default for SymbolTable
source§fn default() -> SymbolTable
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_disassembler/fn.disassemble_from_str.html b/leo_disassembler/fn.disassemble_from_str.html
index 0dc23c5ffd..73dd2bcdf6 100644
--- a/leo_disassembler/fn.disassemble_from_str.html
+++ b/leo_disassembler/fn.disassemble_from_str.html
@@ -1,4 +1,4 @@
disassemble_from_str in leo_disassembler - Rust Function leo_disassembler::disassemble_from_str
source · pub fn disassemble_from_str<N: Network>(
name: &str,
program: &str
-) -> Result<Stub, UtilError>
\ No newline at end of file
+) -> Result<Stub, UtilError>
\ No newline at end of file
diff --git a/leo_errors/common/index.html b/leo_errors/common/index.html
index 9823564797..7349584cbe 100644
--- a/leo_errors/common/index.html
+++ b/leo_errors/common/index.html
@@ -1,2 +1,2 @@
-leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors..
+leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors.
Re-exports§
pub use self::backtraced::*;
pub use self::formatted::*;
pub use self::traits::*;
Modules§
- This module contains a backtraced error and its methods.
- This module contains a formatted error and its methods.
- This module contains the macros for making errors easily.
- This module contains traits for making errors easily.
\ No newline at end of file
diff --git a/leo_errors/errors/enum.LeoError.html b/leo_errors/errors/enum.LeoError.html
index 14a74cc5b9..8ec7a32fc3 100644
--- a/leo_errors/errors/enum.LeoError.html
+++ b/leo_errors/errors/enum.LeoError.html
@@ -13,16 +13,16 @@
}Expand description
The LeoError type that contains all sub error types.
This allows a unified error type throughout the Leo crates.
Variants§
§AstError(AstError)
Represents an AST Error in a Leo Error.
-§CliError(CliError)
Represents an CLI Error in a Leo Error.
-§CompilerError(CompilerError)
Represents an Compiler Error in a Leo Error.
-§PackageError(PackageError)
Represents an Package Error in a Leo Error.
-§ParserError(ParserError)
Represents an Parser Error in a Leo Error.
+§CliError(CliError)
Represents a CLI Error in a Leo Error.
+§CompilerError(CompilerError)
Represents a Compiler Error in a Leo Error.
+§PackageError(PackageError)
Represents a Package Error in a Leo Error.
+§ParserError(ParserError)
Represents a Parser Error in a Leo Error.
§TypeCheckerError(TypeCheckerError)
Represents a Type Checker Error in a Leo Error.
§LoopUnrollerError(LoopUnrollerError)
Represents a Loop Unroller Error in a Leo Error.
§FlattenError(FlattenError)
Represents a Flatten Error in a Leo Error.
§LastErrorCode(i32)
Purely for just exiting with the correct status code and
not re-displaying an error.
-§UtilError(UtilError)
Represents a Utils Error in a Leo Error
+§UtilError(UtilError)
Represents a Utils Error in a Leo Error.
§Anyhow(Error)
Anyhow errors.
Implementations§
source§impl LeoError
sourcepub fn error_code(&self) -> String
Implement error code for each type of Error.
sourcepub fn exit_code(&self) -> i32
Implement exit code for each type of Error.
diff --git a/leo_errors/errors/enum.LeoWarning.html b/leo_errors/errors/enum.LeoWarning.html
index 0faa5539be..c1588d6821 100644
--- a/leo_errors/errors/enum.LeoWarning.html
+++ b/leo_errors/errors/enum.LeoWarning.html
@@ -1,10 +1,10 @@
-LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
+LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
ParserWarning(ParserWarning),
TypeCheckerWarning(TypeCheckerWarning),
-}
Expand description
The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
-Variants§
§ParserWarning(ParserWarning)
Represents an Parser Error in a Leo Error.
-§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Error in a Leo Error.
+}Expand description
The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates.
+Variants§
§ParserWarning(ParserWarning)
Represents an Parser Warning in a Leo Warning.
+§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Warning in a Leo Warning.
Implementations§
source§impl LeoWarning
sourcepub fn error_code(&self) -> String
Implement warning code for each type of Warning.
Trait Implementations§
source§impl Debug for LeoWarning
source§impl Display for LeoWarning
source§impl Error for LeoWarning
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<ParserWarning> for LeoWarning
source§fn from(source: ParserWarning) -> Self
Converts to this type from the input type.source§impl From<TypeCheckerWarning> for LeoWarning
source§fn from(source: TypeCheckerWarning) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for LeoWarning
§impl RefUnwindSafe for LeoWarning
§impl Send for LeoWarning
§impl Sync for LeoWarning
§impl Unpin for LeoWarning
§impl UnwindSafe for LeoWarning
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_errors/errors/index.html b/leo_errors/errors/index.html
index a9aaa3418b..257932bad3 100644
--- a/leo_errors/errors/index.html
+++ b/leo_errors/errors/index.html
@@ -1,4 +1,4 @@
-leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo lang.
+leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo language.
Re-exports§
pub use self::ast::*;
pub use self::cli::*;
pub use self::compiler::*;
pub use self::flattener::*;
pub use self::loop_unroller::*;
pub use self::package::*;
pub use self::parser::*;
pub use self::type_checker::*;
pub use self::utils::*;
Modules§
- Contains the AST error definitions.
- Contains the CLI error definitions.
- Contains the Compiler error definitions.
- Contains the Flattener error definitions.
- Contains the Loop Unroller error definitions.
- Contains the Package error definitions.
- Contains the Parser error definitions.
- Contains the Type Checker error definitions.
- Contains the Utils error definitions.
Enums§
- The LeoError type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
- The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
+This allows a unified error type throughout the Leo crates.The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates. Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
diff --git a/leo_errors/index.html b/leo_errors/index.html
index da14ceb37f..5bbc7ccfbb 100644
--- a/leo_errors/index.html
+++ b/leo_errors/index.html
@@ -46,6 +46,6 @@ §SnarkVM
When SnarkVM implements better error codes and messages, we can bubble them up.
§Utils
The errors related to dependency retrieval in the utils
crate. Its error codes will range from 10_000-10_999 and be prefixed with the characters DEP
.
-
Re-exports§
Modules§
- Contains the common functionalities for defining errors..
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo lang.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
+
Re-exports§
Modules§
- Contains the common functionalities for defining errors.
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo language.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
and error methods generated through a DSL creates and generates errors
with a unique error code.
\ No newline at end of file
diff --git a/leo_package/build/directory/struct.BuildDirectory.html b/leo_package/build/directory/struct.BuildDirectory.html
index fac07569cb..3398708872 100644
--- a/leo_package/build/directory/struct.BuildDirectory.html
+++ b/leo_package/build/directory/struct.BuildDirectory.html
@@ -1,6 +1,6 @@
-BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
source§impl BuildDirectory
sourcepub fn open(path: &Path) -> Result<PathBuf>
Returns the path to the build directory if it exists.
-sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for BuildDirectory
§impl RefUnwindSafe for BuildDirectory
§impl Send for BuildDirectory
§impl Sync for BuildDirectory
§impl Unpin for BuildDirectory
§impl UnwindSafe for BuildDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/fn.parse_file_paths.html b/leo_package/fn.parse_file_paths.html
index 5e8c86b57f..32c80a43ae 100644
--- a/leo_package/fn.parse_file_paths.html
+++ b/leo_package/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package - Rust Function leo_package::parse_file_paths
source · pub(crate) fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/imports/directory/struct.ImportsDirectory.html b/leo_package/imports/directory/struct.ImportsDirectory.html
index f58c759e92..9885ee13dd 100644
--- a/leo_package/imports/directory/struct.ImportsDirectory.html
+++ b/leo_package/imports/directory/struct.ImportsDirectory.html
@@ -1,7 +1,7 @@
-ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name if it does not exist.
-sourcepub fn is_empty(path: &Path) -> Result<bool>
Returns true if the imports directory does not exist or does not contain files.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the imports directory.
+ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
Auto Trait Implementations§
§impl Freeze for ImportsDirectory
§impl RefUnwindSafe for ImportsDirectory
§impl Send for ImportsDirectory
§impl Sync for ImportsDirectory
§impl Unpin for ImportsDirectory
§impl UnwindSafe for ImportsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/inputs/directory/fn.parse_file_paths.html b/leo_package/inputs/directory/fn.parse_file_paths.html
index 1b5a58356c..bbc13fb6c2 100644
--- a/leo_package/inputs/directory/fn.parse_file_paths.html
+++ b/leo_package/inputs/directory/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package::inputs::directory - Rust Function leo_package::inputs::directory::parse_file_paths
source · fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/inputs/directory/struct.InputsDirectory.html b/leo_package/inputs/directory/struct.InputsDirectory.html
index 3be222239e..42e6487029 100644
--- a/leo_package/inputs/directory/struct.InputsDirectory.html
+++ b/leo_package/inputs/directory/struct.InputsDirectory.html
@@ -1,5 +1,5 @@
-InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
source§impl InputsDirectory
sourcepub fn create(path: &Path) -> Result<()>
Creates a directory at the provided path with the default directory name.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the input directory.
+InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for InputsDirectory
§impl RefUnwindSafe for InputsDirectory
§impl Send for InputsDirectory
§impl Sync for InputsDirectory
§impl Unpin for InputsDirectory
§impl UnwindSafe for InputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
index cb29b629d0..fd1493e673 100644
--- a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
+++ b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
@@ -3,8 +3,8 @@
pub snapshot: Snapshot,
}Expand description
Generic Snapshot file wrapper. Each package can have up to 3
different snapshots: initial_ast, canonicalization_ast and type_inferenced_ast;
-Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+
Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn snapshot_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for SnapshotFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for SnapshotFile
§impl RefUnwindSafe for SnapshotFile
§impl Send for SnapshotFile
§impl Sync for SnapshotFile
§impl Unpin for SnapshotFile
§impl UnwindSafe for SnapshotFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/checksum/struct.ChecksumFile.html b/leo_package/outputs/checksum/struct.ChecksumFile.html
index def0ba7fb2..a83b3f87ce 100644
--- a/leo_package/outputs/checksum/struct.ChecksumFile.html
+++ b/leo_package/outputs/checksum/struct.ChecksumFile.html
@@ -1,8 +1,8 @@
ChecksumFile in leo_package::outputs::checksum - Rust Struct leo_package::outputs::checksum::ChecksumFile
source · pub struct ChecksumFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for ChecksumFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ChecksumFile
§impl RefUnwindSafe for ChecksumFile
§impl Send for ChecksumFile
§impl Sync for ChecksumFile
§impl Unpin for ChecksumFile
§impl UnwindSafe for ChecksumFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/circuit/struct.CircuitFile.html b/leo_package/outputs/circuit/struct.CircuitFile.html
index 7a313cccc5..2016ebb713 100644
--- a/leo_package/outputs/circuit/struct.CircuitFile.html
+++ b/leo_package/outputs/circuit/struct.CircuitFile.html
@@ -1,8 +1,8 @@
CircuitFile in leo_package::outputs::circuit - Rust Struct leo_package::outputs::circuit::CircuitFile
source · pub struct CircuitFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for CircuitFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for CircuitFile
§impl RefUnwindSafe for CircuitFile
§impl Send for CircuitFile
§impl Sync for CircuitFile
§impl Unpin for CircuitFile
§impl UnwindSafe for CircuitFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/directory/struct.OutputsDirectory.html b/leo_package/outputs/directory/struct.OutputsDirectory.html
index e6c87e2ceb..eed4aadfb3 100644
--- a/leo_package/outputs/directory/struct.OutputsDirectory.html
+++ b/leo_package/outputs/directory/struct.OutputsDirectory.html
@@ -1,5 +1,5 @@
-OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
source§impl OutputsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for OutputsDirectory
§impl RefUnwindSafe for OutputsDirectory
§impl Send for OutputsDirectory
§impl Sync for OutputsDirectory
§impl Unpin for OutputsDirectory
§impl UnwindSafe for OutputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/package/struct.Package.html b/leo_package/package/struct.Package.html
index 5ddc7ad345..a169387912 100644
--- a/leo_package/package/struct.Package.html
+++ b/leo_package/package/struct.Package.html
@@ -3,8 +3,8 @@
pub version: String,
pub description: Option<String>,
pub license: Option<String>,
- pub network: NetworkName,
-}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
+ pub network: NetworkName,
+}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
Aleo names can only contain ASCII alphanumeric characters and underscores.
sourcepub fn can_initialize(package_name: &str, path: &Path) -> bool
Returns true
if a package is can be initialized at a given path.
impl<T> Borrow<T> for Twhere
diff --git a/leo_compiler/compiler/struct.SymbolTable.html b/leo_compiler/compiler/struct.SymbolTable.html
index dc00879288..7e990f1dc1 100644
--- a/leo_compiler/compiler/struct.SymbolTable.html
+++ b/leo_compiler/compiler/struct.SymbolTable.html
@@ -13,8 +13,8 @@
&self,
location: &Location,
is_struct: bool,
- span: Span
-) -> Result<(), LeoError>Recursively checks if the symbol table contains an entry for the given symbol.
+ span: Span
+) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol.
Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
Returns the current scope index.
Increments the scope index.
@@ -22,35 +22,35 @@
&mut self,
location: Location,
insert: &Function
-) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
-sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SymbolTable
source§impl Default for SymbolTable
source§fn default() -> SymbolTable
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_compiler/struct.Ast.html b/leo_compiler/struct.Ast.html
index ad68be994a..1e6b1d6afa 100644
--- a/leo_compiler/struct.Ast.html
+++ b/leo_compiler/struct.Ast.html
@@ -5,20 +5,20 @@
These data types form a tree that begins from a Program
type root.
Fields§
§ast: Program
Implementations§
source§impl Ast
sourcepub fn as_repr(&self) -> &Program
Returns a reference to the inner program AST representation.
-sourcepub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
+
sourcepub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
Serializes the ast into a JSON file.
+) -> Result<(), LeoError>Serializes the ast into a JSON file.
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<Ast, LeoError>
Deserializes the JSON string into a ast.
-sourcepub fn from_json_file(path: PathBuf) -> Result<Ast, LeoError>
Trait Implementations§
source§impl Eq for Ast
source§impl StructuralPartialEq for Ast
Auto Trait Implementations§
§impl Freeze for Ast
§impl !RefUnwindSafe for Ast
§impl Send for Ast
§impl !Sync for Ast
§impl Unpin for Ast
§impl UnwindSafe for Ast
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_compiler/struct.Compiler.html b/leo_compiler/struct.Compiler.html
index 3b92156fca..753a369be0 100644
--- a/leo_compiler/struct.Compiler.html
+++ b/leo_compiler/struct.Compiler.html
@@ -1,5 +1,5 @@
Compiler in leo_compiler - Rust Struct leo_compiler::Compiler
source · pub struct Compiler<'a, N: Network> {
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
pub program_name: String,
@@ -9,10 +9,10 @@
node_builder: NodeBuilder,
assigner: Assigner,
type_table: TypeTable,
- import_stubs: IndexMap<Symbol, Stub>,
+ import_stubs: IndexMap<Symbol, Stub>,
phantom: PhantomData<N>,
}
Expand description
The primary entry point of the Leo compiler.
-Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
+Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
§main_file_path: PathBuf
The path to the main leo file.
§output_directory: PathBuf
The path to where the compiler outputs all generated files.
§program_name: String
The program name,
@@ -22,57 +22,57 @@
§node_builder: NodeBuilder
The NodeCounter
used to generate sequentially increasing NodeID
s.
§assigner: Assigner
The Assigner
is used to construct (unique) assignment statements.
§type_table: TypeTable
The type table.
-§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
+§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
§phantom: PhantomData<N>
Implementations§
source§impl<'a, N: Network> Compiler<'a, N>
sourcepub fn new(
program_name: String,
network: String,
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
compiler_options: Option<CompilerOptions>,
- import_stubs: IndexMap<Symbol, Stub>
+ import_stubs: IndexMap<Symbol, Stub>
) -> Self
Returns a new Leo compiler.
-sourcepub fn parse_program_from_string(
&mut self,
program_string: &str,
- name: FileName
-) -> Result<()>
Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
-sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
-sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
+ name: FileName
+) -> Result<()>Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
+sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
+sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
sourcepub fn type_checker_pass(
&'a self,
symbol_table: SymbolTable
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the type checker pass.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the type checker pass.
sourcepub fn loop_unrolling_pass(
&mut self,
symbol_table: SymbolTable
-) -> Result<SymbolTable>
Runs the loop unrolling pass.
+) -> Result<SymbolTable>Runs the loop unrolling pass.
sourcepub fn static_single_assignment_pass(
&mut self,
symbol_table: &SymbolTable
-) -> Result<()>
Runs the static single assignment pass.
-sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
-sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
-sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
-sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
+) -> Result<()>Runs the static single assignment pass.
+sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
+sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
+sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
+sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
sourcepub fn code_generation_pass(
&mut self,
symbol_table: &SymbolTable,
struct_graph: &StructGraph,
call_graph: &CallGraph
-) -> Result<String>
Runs the code generation pass.
+) -> Result<String>Runs the code generation pass.
sourcepub fn compiler_stages(
&mut self
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the compiler stages.
-sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the compiler stages.
+sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
sourcefn write_symbol_table_to_json(
&self,
file_suffix: &str,
symbol_table: &SymbolTable
-) -> Result<()>
Writes the Symbol Table to a JSON file.
-sourcepub fn add_import_stubs(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
§impl<'a, N> !Freeze for Compiler<'a, N>
§impl<'a, N> !RefUnwindSafe for Compiler<'a, N>
§impl<'a, N> !Send for Compiler<'a, N>
§impl<'a, N> !Sync for Compiler<'a, N>
§impl<'a, N> Unpin for Compiler<'a, N>where
N: Unpin,
§impl<'a, N> !UnwindSafe for Compiler<'a, N>
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_compiler/struct.SymbolTable.html b/leo_compiler/struct.SymbolTable.html
index abd12cc7c0..cf23f3f321 100644
--- a/leo_compiler/struct.SymbolTable.html
+++ b/leo_compiler/struct.SymbolTable.html
@@ -13,8 +13,8 @@
&self,
location: &Location,
is_struct: bool,
- span: Span
-) -> Result<(), LeoError>Recursively checks if the symbol table contains an entry for the given symbol.
+ span: Span
+) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol.
Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
Returns the current scope index.
Increments the scope index.
@@ -22,35 +22,35 @@
&mut self,
location: Location,
insert: &Function
-) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
-sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SymbolTable
source§impl Default for SymbolTable
source§fn default() -> SymbolTable
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_disassembler/fn.disassemble_from_str.html b/leo_disassembler/fn.disassemble_from_str.html
index 0dc23c5ffd..73dd2bcdf6 100644
--- a/leo_disassembler/fn.disassemble_from_str.html
+++ b/leo_disassembler/fn.disassemble_from_str.html
@@ -1,4 +1,4 @@
disassemble_from_str in leo_disassembler - Rust Function leo_disassembler::disassemble_from_str
source · pub fn disassemble_from_str<N: Network>(
name: &str,
program: &str
-) -> Result<Stub, UtilError>
\ No newline at end of file
+) -> Result<Stub, UtilError>
\ No newline at end of file
diff --git a/leo_errors/common/index.html b/leo_errors/common/index.html
index 9823564797..7349584cbe 100644
--- a/leo_errors/common/index.html
+++ b/leo_errors/common/index.html
@@ -1,2 +1,2 @@
-leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors..
+leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors.
Re-exports§
pub use self::backtraced::*;
pub use self::formatted::*;
pub use self::traits::*;
Modules§
- This module contains a backtraced error and its methods.
- This module contains a formatted error and its methods.
- This module contains the macros for making errors easily.
- This module contains traits for making errors easily.
\ No newline at end of file
diff --git a/leo_errors/errors/enum.LeoError.html b/leo_errors/errors/enum.LeoError.html
index 14a74cc5b9..8ec7a32fc3 100644
--- a/leo_errors/errors/enum.LeoError.html
+++ b/leo_errors/errors/enum.LeoError.html
@@ -13,16 +13,16 @@
}Expand description
The LeoError type that contains all sub error types.
This allows a unified error type throughout the Leo crates.
Variants§
§AstError(AstError)
Represents an AST Error in a Leo Error.
-§CliError(CliError)
Represents an CLI Error in a Leo Error.
-§CompilerError(CompilerError)
Represents an Compiler Error in a Leo Error.
-§PackageError(PackageError)
Represents an Package Error in a Leo Error.
-§ParserError(ParserError)
Represents an Parser Error in a Leo Error.
+§CliError(CliError)
Represents a CLI Error in a Leo Error.
+§CompilerError(CompilerError)
Represents a Compiler Error in a Leo Error.
+§PackageError(PackageError)
Represents a Package Error in a Leo Error.
+§ParserError(ParserError)
Represents a Parser Error in a Leo Error.
§TypeCheckerError(TypeCheckerError)
Represents a Type Checker Error in a Leo Error.
§LoopUnrollerError(LoopUnrollerError)
Represents a Loop Unroller Error in a Leo Error.
§FlattenError(FlattenError)
Represents a Flatten Error in a Leo Error.
§LastErrorCode(i32)
Purely for just exiting with the correct status code and
not re-displaying an error.
-§UtilError(UtilError)
Represents a Utils Error in a Leo Error
+§UtilError(UtilError)
Represents a Utils Error in a Leo Error.
§Anyhow(Error)
Anyhow errors.
Implementations§
source§impl LeoError
sourcepub fn error_code(&self) -> String
Implement error code for each type of Error.
sourcepub fn exit_code(&self) -> i32
Implement exit code for each type of Error.
diff --git a/leo_errors/errors/enum.LeoWarning.html b/leo_errors/errors/enum.LeoWarning.html
index 0faa5539be..c1588d6821 100644
--- a/leo_errors/errors/enum.LeoWarning.html
+++ b/leo_errors/errors/enum.LeoWarning.html
@@ -1,10 +1,10 @@
-LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
+LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
ParserWarning(ParserWarning),
TypeCheckerWarning(TypeCheckerWarning),
-}
Expand description
The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
-Variants§
§ParserWarning(ParserWarning)
Represents an Parser Error in a Leo Error.
-§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Error in a Leo Error.
+}Expand description
The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates.
+Variants§
§ParserWarning(ParserWarning)
Represents an Parser Warning in a Leo Warning.
+§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Warning in a Leo Warning.
Implementations§
source§impl LeoWarning
sourcepub fn error_code(&self) -> String
Implement warning code for each type of Warning.
Trait Implementations§
source§impl Debug for LeoWarning
source§impl Display for LeoWarning
source§impl Error for LeoWarning
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<ParserWarning> for LeoWarning
source§fn from(source: ParserWarning) -> Self
Converts to this type from the input type.source§impl From<TypeCheckerWarning> for LeoWarning
source§fn from(source: TypeCheckerWarning) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for LeoWarning
§impl RefUnwindSafe for LeoWarning
§impl Send for LeoWarning
§impl Sync for LeoWarning
§impl Unpin for LeoWarning
§impl UnwindSafe for LeoWarning
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_errors/errors/index.html b/leo_errors/errors/index.html
index a9aaa3418b..257932bad3 100644
--- a/leo_errors/errors/index.html
+++ b/leo_errors/errors/index.html
@@ -1,4 +1,4 @@
-leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo lang.
+leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo language.
Re-exports§
pub use self::ast::*;
pub use self::cli::*;
pub use self::compiler::*;
pub use self::flattener::*;
pub use self::loop_unroller::*;
pub use self::package::*;
pub use self::parser::*;
pub use self::type_checker::*;
pub use self::utils::*;
Modules§
- Contains the AST error definitions.
- Contains the CLI error definitions.
- Contains the Compiler error definitions.
- Contains the Flattener error definitions.
- Contains the Loop Unroller error definitions.
- Contains the Package error definitions.
- Contains the Parser error definitions.
- Contains the Type Checker error definitions.
- Contains the Utils error definitions.
Enums§
- The LeoError type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
- The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
+This allows a unified error type throughout the Leo crates.The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates. Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
diff --git a/leo_errors/index.html b/leo_errors/index.html
index da14ceb37f..5bbc7ccfbb 100644
--- a/leo_errors/index.html
+++ b/leo_errors/index.html
@@ -46,6 +46,6 @@ §SnarkVM
When SnarkVM implements better error codes and messages, we can bubble them up.
§Utils
The errors related to dependency retrieval in the utils
crate. Its error codes will range from 10_000-10_999 and be prefixed with the characters DEP
.
-
Re-exports§
Modules§
- Contains the common functionalities for defining errors..
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo lang.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
+
Re-exports§
Modules§
- Contains the common functionalities for defining errors.
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo language.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
and error methods generated through a DSL creates and generates errors
with a unique error code.
\ No newline at end of file
diff --git a/leo_package/build/directory/struct.BuildDirectory.html b/leo_package/build/directory/struct.BuildDirectory.html
index fac07569cb..3398708872 100644
--- a/leo_package/build/directory/struct.BuildDirectory.html
+++ b/leo_package/build/directory/struct.BuildDirectory.html
@@ -1,6 +1,6 @@
-BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
source§impl BuildDirectory
sourcepub fn open(path: &Path) -> Result<PathBuf>
Returns the path to the build directory if it exists.
-sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for BuildDirectory
§impl RefUnwindSafe for BuildDirectory
§impl Send for BuildDirectory
§impl Sync for BuildDirectory
§impl Unpin for BuildDirectory
§impl UnwindSafe for BuildDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/fn.parse_file_paths.html b/leo_package/fn.parse_file_paths.html
index 5e8c86b57f..32c80a43ae 100644
--- a/leo_package/fn.parse_file_paths.html
+++ b/leo_package/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package - Rust Function leo_package::parse_file_paths
source · pub(crate) fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/imports/directory/struct.ImportsDirectory.html b/leo_package/imports/directory/struct.ImportsDirectory.html
index f58c759e92..9885ee13dd 100644
--- a/leo_package/imports/directory/struct.ImportsDirectory.html
+++ b/leo_package/imports/directory/struct.ImportsDirectory.html
@@ -1,7 +1,7 @@
-ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name if it does not exist.
-sourcepub fn is_empty(path: &Path) -> Result<bool>
Returns true if the imports directory does not exist or does not contain files.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the imports directory.
+ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
Auto Trait Implementations§
§impl Freeze for ImportsDirectory
§impl RefUnwindSafe for ImportsDirectory
§impl Send for ImportsDirectory
§impl Sync for ImportsDirectory
§impl Unpin for ImportsDirectory
§impl UnwindSafe for ImportsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/inputs/directory/fn.parse_file_paths.html b/leo_package/inputs/directory/fn.parse_file_paths.html
index 1b5a58356c..bbc13fb6c2 100644
--- a/leo_package/inputs/directory/fn.parse_file_paths.html
+++ b/leo_package/inputs/directory/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package::inputs::directory - Rust Function leo_package::inputs::directory::parse_file_paths
source · fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/inputs/directory/struct.InputsDirectory.html b/leo_package/inputs/directory/struct.InputsDirectory.html
index 3be222239e..42e6487029 100644
--- a/leo_package/inputs/directory/struct.InputsDirectory.html
+++ b/leo_package/inputs/directory/struct.InputsDirectory.html
@@ -1,5 +1,5 @@
-InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
source§impl InputsDirectory
sourcepub fn create(path: &Path) -> Result<()>
Creates a directory at the provided path with the default directory name.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the input directory.
+InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for InputsDirectory
§impl RefUnwindSafe for InputsDirectory
§impl Send for InputsDirectory
§impl Sync for InputsDirectory
§impl Unpin for InputsDirectory
§impl UnwindSafe for InputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
index cb29b629d0..fd1493e673 100644
--- a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
+++ b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
@@ -3,8 +3,8 @@
pub snapshot: Snapshot,
}Expand description
Generic Snapshot file wrapper. Each package can have up to 3
different snapshots: initial_ast, canonicalization_ast and type_inferenced_ast;
-Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+
Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn snapshot_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for SnapshotFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for SnapshotFile
§impl RefUnwindSafe for SnapshotFile
§impl Send for SnapshotFile
§impl Sync for SnapshotFile
§impl Unpin for SnapshotFile
§impl UnwindSafe for SnapshotFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/checksum/struct.ChecksumFile.html b/leo_package/outputs/checksum/struct.ChecksumFile.html
index def0ba7fb2..a83b3f87ce 100644
--- a/leo_package/outputs/checksum/struct.ChecksumFile.html
+++ b/leo_package/outputs/checksum/struct.ChecksumFile.html
@@ -1,8 +1,8 @@
ChecksumFile in leo_package::outputs::checksum - Rust Struct leo_package::outputs::checksum::ChecksumFile
source · pub struct ChecksumFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for ChecksumFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ChecksumFile
§impl RefUnwindSafe for ChecksumFile
§impl Send for ChecksumFile
§impl Sync for ChecksumFile
§impl Unpin for ChecksumFile
§impl UnwindSafe for ChecksumFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/circuit/struct.CircuitFile.html b/leo_package/outputs/circuit/struct.CircuitFile.html
index 7a313cccc5..2016ebb713 100644
--- a/leo_package/outputs/circuit/struct.CircuitFile.html
+++ b/leo_package/outputs/circuit/struct.CircuitFile.html
@@ -1,8 +1,8 @@
CircuitFile in leo_package::outputs::circuit - Rust Struct leo_package::outputs::circuit::CircuitFile
source · pub struct CircuitFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for CircuitFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for CircuitFile
§impl RefUnwindSafe for CircuitFile
§impl Send for CircuitFile
§impl Sync for CircuitFile
§impl Unpin for CircuitFile
§impl UnwindSafe for CircuitFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/directory/struct.OutputsDirectory.html b/leo_package/outputs/directory/struct.OutputsDirectory.html
index e6c87e2ceb..eed4aadfb3 100644
--- a/leo_package/outputs/directory/struct.OutputsDirectory.html
+++ b/leo_package/outputs/directory/struct.OutputsDirectory.html
@@ -1,5 +1,5 @@
-OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
source§impl OutputsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for OutputsDirectory
§impl RefUnwindSafe for OutputsDirectory
§impl Send for OutputsDirectory
§impl Sync for OutputsDirectory
§impl Unpin for OutputsDirectory
§impl UnwindSafe for OutputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/package/struct.Package.html b/leo_package/package/struct.Package.html
index 5ddc7ad345..a169387912 100644
--- a/leo_package/package/struct.Package.html
+++ b/leo_package/package/struct.Package.html
@@ -3,8 +3,8 @@
pub version: String,
pub description: Option<String>,
pub license: Option<String>,
- pub network: NetworkName,
-}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
+ pub network: NetworkName,
+}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
Aleo names can only contain ASCII alphanumeric characters and underscores.
sourcepub fn can_initialize(package_name: &str, path: &Path) -> bool
Returns true
if a package is can be initialized at a given path.
Recursively checks if the symbol table contains an entry for the given symbol. + span: Span +) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol. Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
pub fn scope_index(&mut self) -> usize
Returns the current scope index. Increments the scope index.
@@ -22,35 +22,35 @@ &mut self, location: Location, insert: &Function -) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
pub fn insert_struct( &mut self, location: Location, insert: &Composite -) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
pub fn attach_finalize( &mut self, caller: Location, callee: Location -) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
pub fn insert_variable( &mut self, location: Location, insert: VariableSymbol -) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
pub fn insert_futures( &mut self, - program: Symbol, - function: Symbol, + program: Symbol, + function: Symbol, futures: Vec<Location> -) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
pub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
pub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
pub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
pub fn lookup_struct( &self, location: Location, - main_program: Option<Symbol> + main_program: Option<Symbol> ) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
pub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
pub fn lookup_variable_in_current_scope( @@ -61,20 +61,20 @@ &self, index: usize ) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
pub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
pub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
pub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
pub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
pub fn to_json_file( &self, path: PathBuf, file_name: &str -) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
pub fn to_json_file_without_keys( +) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
pub fn to_json_file_without_keys( &self, path: PathBuf, file_name: &str, excluded_keys: &[&str] -) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
pub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
pub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
pub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
pub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
fn clone(&self) -> SymbolTable
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SymbolTable
impl Debug for SymbolTable
source§impl Default for SymbolTable
impl Default for SymbolTable
source§fn default() -> SymbolTable
fn default() -> SymbolTable
source§impl<'de> Deserialize<'de> for SymbolTable
impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_compiler/struct.Ast.html b/leo_compiler/struct.Ast.html
index ad68be994a..1e6b1d6afa 100644
--- a/leo_compiler/struct.Ast.html
+++ b/leo_compiler/struct.Ast.html
@@ -5,20 +5,20 @@
These data types form a tree that begins from a Program
type root.
fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_compiler/struct.Ast.html b/leo_compiler/struct.Ast.html
index ad68be994a..1e6b1d6afa 100644
--- a/leo_compiler/struct.Ast.html
+++ b/leo_compiler/struct.Ast.html
@@ -5,20 +5,20 @@
These data types form a tree that begins from a Program
type root.
Program
type root.
Fields§
§ast: Program
Implementations§
source§impl Ast
impl Ast
sourcepub fn as_repr(&self) -> &Program
pub fn as_repr(&self) -> &Program
Returns a reference to the inner program AST representation.
-pub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
pub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
-pub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
+
pub fn to_json_file( +
pub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
pub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the ast into a JSON string.
+pub fn to_json_value(&self) -> Result<Value, LeoError>
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
pub fn to_json_file( &self, path: PathBuf, file_name: &str -) -> Result<(), LeoError>
Serializes the ast into a JSON file.
+) -> Result<(), LeoError>Serializes the ast into a JSON file.
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
pub fn to_json_file_without_keys( &self, path: PathBuf, file_name: &str, excluded_keys: &[&str] -) -> Result<(), LeoError>
Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<Ast, LeoError>
pub fn from_json_string(json: &str) -> Result<Ast, LeoError>
Deserializes the JSON string into a ast.
-sourcepub fn from_json_file(path: PathBuf) -> Result<Ast, LeoError>
pub fn from_json_file(path: PathBuf) -> Result<Ast, LeoError>
Trait Implementations§
impl Eq for Ast
impl StructuralPartialEq for Ast
Auto Trait Implementations§
impl Freeze for Ast
impl !RefUnwindSafe for Ast
impl Send for Ast
impl !Sync for Ast
impl Unpin for Ast
impl UnwindSafe for Ast
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_compiler/struct.Compiler.html b/leo_compiler/struct.Compiler.html
index 3b92156fca..753a369be0 100644
--- a/leo_compiler/struct.Compiler.html
+++ b/leo_compiler/struct.Compiler.html
@@ -1,5 +1,5 @@
Compiler in leo_compiler - Rust Struct leo_compiler::Compiler
source · pub struct Compiler<'a, N: Network> {
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
pub program_name: String,
@@ -9,10 +9,10 @@
node_builder: NodeBuilder,
assigner: Assigner,
type_table: TypeTable,
- import_stubs: IndexMap<Symbol, Stub>,
+ import_stubs: IndexMap<Symbol, Stub>,
phantom: PhantomData<N>,
}
Expand description
The primary entry point of the Leo compiler.
-Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
+Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
§main_file_path: PathBuf
The path to the main leo file.
§output_directory: PathBuf
The path to where the compiler outputs all generated files.
§program_name: String
The program name,
@@ -22,57 +22,57 @@
§node_builder: NodeBuilder
The NodeCounter
used to generate sequentially increasing NodeID
s.
§assigner: Assigner
The Assigner
is used to construct (unique) assignment statements.
§type_table: TypeTable
The type table.
-§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
+§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
§phantom: PhantomData<N>
Implementations§
source§impl<'a, N: Network> Compiler<'a, N>
sourcepub fn new(
program_name: String,
network: String,
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
compiler_options: Option<CompilerOptions>,
- import_stubs: IndexMap<Symbol, Stub>
+ import_stubs: IndexMap<Symbol, Stub>
) -> Self
Returns a new Leo compiler.
-sourcepub fn parse_program_from_string(
&mut self,
program_string: &str,
- name: FileName
-) -> Result<()>
Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
-sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
-sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
+ name: FileName
+) -> Result<()>Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
+sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
+sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
sourcepub fn type_checker_pass(
&'a self,
symbol_table: SymbolTable
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the type checker pass.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the type checker pass.
sourcepub fn loop_unrolling_pass(
&mut self,
symbol_table: SymbolTable
-) -> Result<SymbolTable>
Runs the loop unrolling pass.
+) -> Result<SymbolTable>Runs the loop unrolling pass.
sourcepub fn static_single_assignment_pass(
&mut self,
symbol_table: &SymbolTable
-) -> Result<()>
Runs the static single assignment pass.
-sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
-sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
-sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
-sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
+) -> Result<()>Runs the static single assignment pass.
+sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
+sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
+sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
+sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
sourcepub fn code_generation_pass(
&mut self,
symbol_table: &SymbolTable,
struct_graph: &StructGraph,
call_graph: &CallGraph
-) -> Result<String>
Runs the code generation pass.
+) -> Result<String>Runs the code generation pass.
sourcepub fn compiler_stages(
&mut self
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the compiler stages.
-sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the compiler stages.
+sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
sourcefn write_symbol_table_to_json(
&self,
file_suffix: &str,
symbol_table: &SymbolTable
-) -> Result<()>
Writes the Symbol Table to a JSON file.
-sourcepub fn add_import_stubs(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
§impl<'a, N> !Freeze for Compiler<'a, N>
§impl<'a, N> !RefUnwindSafe for Compiler<'a, N>
§impl<'a, N> !Send for Compiler<'a, N>
§impl<'a, N> !Sync for Compiler<'a, N>
§impl<'a, N> Unpin for Compiler<'a, N>where
N: Unpin,
§impl<'a, N> !UnwindSafe for Compiler<'a, N>
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_compiler/struct.SymbolTable.html b/leo_compiler/struct.SymbolTable.html
index abd12cc7c0..cf23f3f321 100644
--- a/leo_compiler/struct.SymbolTable.html
+++ b/leo_compiler/struct.SymbolTable.html
@@ -13,8 +13,8 @@
&self,
location: &Location,
is_struct: bool,
- span: Span
-) -> Result<(), LeoError>Recursively checks if the symbol table contains an entry for the given symbol.
+ span: Span
+) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol.
Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
Returns the current scope index.
Increments the scope index.
@@ -22,35 +22,35 @@
&mut self,
location: Location,
insert: &Function
-) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
-sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SymbolTable
source§impl Default for SymbolTable
source§fn default() -> SymbolTable
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_disassembler/fn.disassemble_from_str.html b/leo_disassembler/fn.disassemble_from_str.html
index 0dc23c5ffd..73dd2bcdf6 100644
--- a/leo_disassembler/fn.disassemble_from_str.html
+++ b/leo_disassembler/fn.disassemble_from_str.html
@@ -1,4 +1,4 @@
disassemble_from_str in leo_disassembler - Rust Function leo_disassembler::disassemble_from_str
source · pub fn disassemble_from_str<N: Network>(
name: &str,
program: &str
-) -> Result<Stub, UtilError>
\ No newline at end of file
+) -> Result<Stub, UtilError>
\ No newline at end of file
diff --git a/leo_errors/common/index.html b/leo_errors/common/index.html
index 9823564797..7349584cbe 100644
--- a/leo_errors/common/index.html
+++ b/leo_errors/common/index.html
@@ -1,2 +1,2 @@
-leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors..
+leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors.
Re-exports§
pub use self::backtraced::*;
pub use self::formatted::*;
pub use self::traits::*;
Modules§
- This module contains a backtraced error and its methods.
- This module contains a formatted error and its methods.
- This module contains the macros for making errors easily.
- This module contains traits for making errors easily.
\ No newline at end of file
diff --git a/leo_errors/errors/enum.LeoError.html b/leo_errors/errors/enum.LeoError.html
index 14a74cc5b9..8ec7a32fc3 100644
--- a/leo_errors/errors/enum.LeoError.html
+++ b/leo_errors/errors/enum.LeoError.html
@@ -13,16 +13,16 @@
}Expand description
The LeoError type that contains all sub error types.
This allows a unified error type throughout the Leo crates.
Variants§
§AstError(AstError)
Represents an AST Error in a Leo Error.
-§CliError(CliError)
Represents an CLI Error in a Leo Error.
-§CompilerError(CompilerError)
Represents an Compiler Error in a Leo Error.
-§PackageError(PackageError)
Represents an Package Error in a Leo Error.
-§ParserError(ParserError)
Represents an Parser Error in a Leo Error.
+§CliError(CliError)
Represents a CLI Error in a Leo Error.
+§CompilerError(CompilerError)
Represents a Compiler Error in a Leo Error.
+§PackageError(PackageError)
Represents a Package Error in a Leo Error.
+§ParserError(ParserError)
Represents a Parser Error in a Leo Error.
§TypeCheckerError(TypeCheckerError)
Represents a Type Checker Error in a Leo Error.
§LoopUnrollerError(LoopUnrollerError)
Represents a Loop Unroller Error in a Leo Error.
§FlattenError(FlattenError)
Represents a Flatten Error in a Leo Error.
§LastErrorCode(i32)
Purely for just exiting with the correct status code and
not re-displaying an error.
-§UtilError(UtilError)
Represents a Utils Error in a Leo Error
+§UtilError(UtilError)
Represents a Utils Error in a Leo Error.
§Anyhow(Error)
Anyhow errors.
Implementations§
source§impl LeoError
sourcepub fn error_code(&self) -> String
Implement error code for each type of Error.
sourcepub fn exit_code(&self) -> i32
Implement exit code for each type of Error.
diff --git a/leo_errors/errors/enum.LeoWarning.html b/leo_errors/errors/enum.LeoWarning.html
index 0faa5539be..c1588d6821 100644
--- a/leo_errors/errors/enum.LeoWarning.html
+++ b/leo_errors/errors/enum.LeoWarning.html
@@ -1,10 +1,10 @@
-LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
+LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
ParserWarning(ParserWarning),
TypeCheckerWarning(TypeCheckerWarning),
-}
Expand description
The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
-Variants§
§ParserWarning(ParserWarning)
Represents an Parser Error in a Leo Error.
-§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Error in a Leo Error.
+}Expand description
The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates.
+Variants§
§ParserWarning(ParserWarning)
Represents an Parser Warning in a Leo Warning.
+§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Warning in a Leo Warning.
Implementations§
source§impl LeoWarning
sourcepub fn error_code(&self) -> String
Implement warning code for each type of Warning.
Trait Implementations§
source§impl Debug for LeoWarning
source§impl Display for LeoWarning
source§impl Error for LeoWarning
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<ParserWarning> for LeoWarning
source§fn from(source: ParserWarning) -> Self
Converts to this type from the input type.source§impl From<TypeCheckerWarning> for LeoWarning
source§fn from(source: TypeCheckerWarning) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for LeoWarning
§impl RefUnwindSafe for LeoWarning
§impl Send for LeoWarning
§impl Sync for LeoWarning
§impl Unpin for LeoWarning
§impl UnwindSafe for LeoWarning
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_errors/errors/index.html b/leo_errors/errors/index.html
index a9aaa3418b..257932bad3 100644
--- a/leo_errors/errors/index.html
+++ b/leo_errors/errors/index.html
@@ -1,4 +1,4 @@
-leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo lang.
+leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo language.
Re-exports§
pub use self::ast::*;
pub use self::cli::*;
pub use self::compiler::*;
pub use self::flattener::*;
pub use self::loop_unroller::*;
pub use self::package::*;
pub use self::parser::*;
pub use self::type_checker::*;
pub use self::utils::*;
Modules§
- Contains the AST error definitions.
- Contains the CLI error definitions.
- Contains the Compiler error definitions.
- Contains the Flattener error definitions.
- Contains the Loop Unroller error definitions.
- Contains the Package error definitions.
- Contains the Parser error definitions.
- Contains the Type Checker error definitions.
- Contains the Utils error definitions.
Enums§
- The LeoError type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
- The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
+This allows a unified error type throughout the Leo crates.The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates. Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
diff --git a/leo_errors/index.html b/leo_errors/index.html
index da14ceb37f..5bbc7ccfbb 100644
--- a/leo_errors/index.html
+++ b/leo_errors/index.html
@@ -46,6 +46,6 @@ §SnarkVM
When SnarkVM implements better error codes and messages, we can bubble them up.
§Utils
The errors related to dependency retrieval in the utils
crate. Its error codes will range from 10_000-10_999 and be prefixed with the characters DEP
.
-
Re-exports§
Modules§
- Contains the common functionalities for defining errors..
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo lang.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
+
Re-exports§
Modules§
- Contains the common functionalities for defining errors.
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo language.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
and error methods generated through a DSL creates and generates errors
with a unique error code.
\ No newline at end of file
diff --git a/leo_package/build/directory/struct.BuildDirectory.html b/leo_package/build/directory/struct.BuildDirectory.html
index fac07569cb..3398708872 100644
--- a/leo_package/build/directory/struct.BuildDirectory.html
+++ b/leo_package/build/directory/struct.BuildDirectory.html
@@ -1,6 +1,6 @@
-BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
source§impl BuildDirectory
sourcepub fn open(path: &Path) -> Result<PathBuf>
Returns the path to the build directory if it exists.
-sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for BuildDirectory
§impl RefUnwindSafe for BuildDirectory
§impl Send for BuildDirectory
§impl Sync for BuildDirectory
§impl Unpin for BuildDirectory
§impl UnwindSafe for BuildDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/fn.parse_file_paths.html b/leo_package/fn.parse_file_paths.html
index 5e8c86b57f..32c80a43ae 100644
--- a/leo_package/fn.parse_file_paths.html
+++ b/leo_package/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package - Rust Function leo_package::parse_file_paths
source · pub(crate) fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/imports/directory/struct.ImportsDirectory.html b/leo_package/imports/directory/struct.ImportsDirectory.html
index f58c759e92..9885ee13dd 100644
--- a/leo_package/imports/directory/struct.ImportsDirectory.html
+++ b/leo_package/imports/directory/struct.ImportsDirectory.html
@@ -1,7 +1,7 @@
-ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name if it does not exist.
-sourcepub fn is_empty(path: &Path) -> Result<bool>
Returns true if the imports directory does not exist or does not contain files.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the imports directory.
+ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
Auto Trait Implementations§
§impl Freeze for ImportsDirectory
§impl RefUnwindSafe for ImportsDirectory
§impl Send for ImportsDirectory
§impl Sync for ImportsDirectory
§impl Unpin for ImportsDirectory
§impl UnwindSafe for ImportsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/inputs/directory/fn.parse_file_paths.html b/leo_package/inputs/directory/fn.parse_file_paths.html
index 1b5a58356c..bbc13fb6c2 100644
--- a/leo_package/inputs/directory/fn.parse_file_paths.html
+++ b/leo_package/inputs/directory/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package::inputs::directory - Rust Function leo_package::inputs::directory::parse_file_paths
source · fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/inputs/directory/struct.InputsDirectory.html b/leo_package/inputs/directory/struct.InputsDirectory.html
index 3be222239e..42e6487029 100644
--- a/leo_package/inputs/directory/struct.InputsDirectory.html
+++ b/leo_package/inputs/directory/struct.InputsDirectory.html
@@ -1,5 +1,5 @@
-InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
source§impl InputsDirectory
sourcepub fn create(path: &Path) -> Result<()>
Creates a directory at the provided path with the default directory name.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the input directory.
+InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for InputsDirectory
§impl RefUnwindSafe for InputsDirectory
§impl Send for InputsDirectory
§impl Sync for InputsDirectory
§impl Unpin for InputsDirectory
§impl UnwindSafe for InputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
index cb29b629d0..fd1493e673 100644
--- a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
+++ b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
@@ -3,8 +3,8 @@
pub snapshot: Snapshot,
}Expand description
Generic Snapshot file wrapper. Each package can have up to 3
different snapshots: initial_ast, canonicalization_ast and type_inferenced_ast;
-Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+
Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn snapshot_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for SnapshotFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for SnapshotFile
§impl RefUnwindSafe for SnapshotFile
§impl Send for SnapshotFile
§impl Sync for SnapshotFile
§impl Unpin for SnapshotFile
§impl UnwindSafe for SnapshotFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/checksum/struct.ChecksumFile.html b/leo_package/outputs/checksum/struct.ChecksumFile.html
index def0ba7fb2..a83b3f87ce 100644
--- a/leo_package/outputs/checksum/struct.ChecksumFile.html
+++ b/leo_package/outputs/checksum/struct.ChecksumFile.html
@@ -1,8 +1,8 @@
ChecksumFile in leo_package::outputs::checksum - Rust Struct leo_package::outputs::checksum::ChecksumFile
source · pub struct ChecksumFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for ChecksumFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ChecksumFile
§impl RefUnwindSafe for ChecksumFile
§impl Send for ChecksumFile
§impl Sync for ChecksumFile
§impl Unpin for ChecksumFile
§impl UnwindSafe for ChecksumFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/circuit/struct.CircuitFile.html b/leo_package/outputs/circuit/struct.CircuitFile.html
index 7a313cccc5..2016ebb713 100644
--- a/leo_package/outputs/circuit/struct.CircuitFile.html
+++ b/leo_package/outputs/circuit/struct.CircuitFile.html
@@ -1,8 +1,8 @@
CircuitFile in leo_package::outputs::circuit - Rust Struct leo_package::outputs::circuit::CircuitFile
source · pub struct CircuitFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for CircuitFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for CircuitFile
§impl RefUnwindSafe for CircuitFile
§impl Send for CircuitFile
§impl Sync for CircuitFile
§impl Unpin for CircuitFile
§impl UnwindSafe for CircuitFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/directory/struct.OutputsDirectory.html b/leo_package/outputs/directory/struct.OutputsDirectory.html
index e6c87e2ceb..eed4aadfb3 100644
--- a/leo_package/outputs/directory/struct.OutputsDirectory.html
+++ b/leo_package/outputs/directory/struct.OutputsDirectory.html
@@ -1,5 +1,5 @@
-OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
source§impl OutputsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for OutputsDirectory
§impl RefUnwindSafe for OutputsDirectory
§impl Send for OutputsDirectory
§impl Sync for OutputsDirectory
§impl Unpin for OutputsDirectory
§impl UnwindSafe for OutputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/package/struct.Package.html b/leo_package/package/struct.Package.html
index 5ddc7ad345..a169387912 100644
--- a/leo_package/package/struct.Package.html
+++ b/leo_package/package/struct.Package.html
@@ -3,8 +3,8 @@
pub version: String,
pub description: Option<String>,
pub license: Option<String>,
- pub network: NetworkName,
-}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
+ pub network: NetworkName,
+}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
Aleo names can only contain ASCII alphanumeric characters and underscores.
sourcepub fn can_initialize(package_name: &str, path: &Path) -> bool
Returns true
if a package is can be initialized at a given path.
impl<T> Any for Twhere
diff --git a/leo_compiler/struct.Compiler.html b/leo_compiler/struct.Compiler.html
index 3b92156fca..753a369be0 100644
--- a/leo_compiler/struct.Compiler.html
+++ b/leo_compiler/struct.Compiler.html
@@ -1,5 +1,5 @@
Compiler in leo_compiler - Rust Struct leo_compiler::Compiler
source · pub struct Compiler<'a, N: Network> {
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
pub program_name: String,
@@ -9,10 +9,10 @@
node_builder: NodeBuilder,
assigner: Assigner,
type_table: TypeTable,
- import_stubs: IndexMap<Symbol, Stub>,
+ import_stubs: IndexMap<Symbol, Stub>,
phantom: PhantomData<N>,
}
Expand description
The primary entry point of the Leo compiler.
-Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
+Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
§main_file_path: PathBuf
The path to the main leo file.
§output_directory: PathBuf
The path to where the compiler outputs all generated files.
§program_name: String
The program name,
@@ -22,57 +22,57 @@
§node_builder: NodeBuilder
The NodeCounter
used to generate sequentially increasing NodeID
s.
§assigner: Assigner
The Assigner
is used to construct (unique) assignment statements.
§type_table: TypeTable
The type table.
-§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
+§import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
§phantom: PhantomData<N>
Implementations§
source§impl<'a, N: Network> Compiler<'a, N>
sourcepub fn new(
program_name: String,
network: String,
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
compiler_options: Option<CompilerOptions>,
- import_stubs: IndexMap<Symbol, Stub>
+ import_stubs: IndexMap<Symbol, Stub>
) -> Self
Returns a new Leo compiler.
-sourcepub fn parse_program_from_string(
&mut self,
program_string: &str,
- name: FileName
-) -> Result<()>
Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
-sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
-sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
+ name: FileName
+) -> Result<()>Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
+sourcepub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
+sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
sourcepub fn type_checker_pass(
&'a self,
symbol_table: SymbolTable
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the type checker pass.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the type checker pass.
sourcepub fn loop_unrolling_pass(
&mut self,
symbol_table: SymbolTable
-) -> Result<SymbolTable>
Runs the loop unrolling pass.
+) -> Result<SymbolTable>Runs the loop unrolling pass.
sourcepub fn static_single_assignment_pass(
&mut self,
symbol_table: &SymbolTable
-) -> Result<()>
Runs the static single assignment pass.
-sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
-sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
-sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
-sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
+) -> Result<()>Runs the static single assignment pass.
+sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
+sourcepub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
+sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
+sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
sourcepub fn code_generation_pass(
&mut self,
symbol_table: &SymbolTable,
struct_graph: &StructGraph,
call_graph: &CallGraph
-) -> Result<String>
Runs the code generation pass.
+) -> Result<String>Runs the code generation pass.
sourcepub fn compiler_stages(
&mut self
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the compiler stages.
-sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the compiler stages.
+sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
sourcefn write_symbol_table_to_json(
&self,
file_suffix: &str,
symbol_table: &SymbolTable
-) -> Result<()>
Writes the Symbol Table to a JSON file.
-sourcepub fn add_import_stubs(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
§impl<'a, N> !Freeze for Compiler<'a, N>
§impl<'a, N> !RefUnwindSafe for Compiler<'a, N>
§impl<'a, N> !Send for Compiler<'a, N>
§impl<'a, N> !Sync for Compiler<'a, N>
§impl<'a, N> Unpin for Compiler<'a, N>where
N: Unpin,
§impl<'a, N> !UnwindSafe for Compiler<'a, N>
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_compiler/struct.SymbolTable.html b/leo_compiler/struct.SymbolTable.html
index abd12cc7c0..cf23f3f321 100644
--- a/leo_compiler/struct.SymbolTable.html
+++ b/leo_compiler/struct.SymbolTable.html
@@ -13,8 +13,8 @@
&self,
location: &Location,
is_struct: bool,
- span: Span
-) -> Result<(), LeoError>Recursively checks if the symbol table contains an entry for the given symbol.
+ span: Span
+) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol.
Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
Returns the current scope index.
Increments the scope index.
@@ -22,35 +22,35 @@
&mut self,
location: Location,
insert: &Function
-) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
-sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SymbolTable
source§impl Default for SymbolTable
source§fn default() -> SymbolTable
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_disassembler/fn.disassemble_from_str.html b/leo_disassembler/fn.disassemble_from_str.html
index 0dc23c5ffd..73dd2bcdf6 100644
--- a/leo_disassembler/fn.disassemble_from_str.html
+++ b/leo_disassembler/fn.disassemble_from_str.html
@@ -1,4 +1,4 @@
disassemble_from_str in leo_disassembler - Rust Function leo_disassembler::disassemble_from_str
source · pub fn disassemble_from_str<N: Network>(
name: &str,
program: &str
-) -> Result<Stub, UtilError>
\ No newline at end of file
+) -> Result<Stub, UtilError>
\ No newline at end of file
diff --git a/leo_errors/common/index.html b/leo_errors/common/index.html
index 9823564797..7349584cbe 100644
--- a/leo_errors/common/index.html
+++ b/leo_errors/common/index.html
@@ -1,2 +1,2 @@
-leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors..
+leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors.
Re-exports§
pub use self::backtraced::*;
pub use self::formatted::*;
pub use self::traits::*;
Modules§
- This module contains a backtraced error and its methods.
- This module contains a formatted error and its methods.
- This module contains the macros for making errors easily.
- This module contains traits for making errors easily.
\ No newline at end of file
diff --git a/leo_errors/errors/enum.LeoError.html b/leo_errors/errors/enum.LeoError.html
index 14a74cc5b9..8ec7a32fc3 100644
--- a/leo_errors/errors/enum.LeoError.html
+++ b/leo_errors/errors/enum.LeoError.html
@@ -13,16 +13,16 @@
}Expand description
The LeoError type that contains all sub error types.
This allows a unified error type throughout the Leo crates.
Variants§
§AstError(AstError)
Represents an AST Error in a Leo Error.
-§CliError(CliError)
Represents an CLI Error in a Leo Error.
-§CompilerError(CompilerError)
Represents an Compiler Error in a Leo Error.
-§PackageError(PackageError)
Represents an Package Error in a Leo Error.
-§ParserError(ParserError)
Represents an Parser Error in a Leo Error.
+§CliError(CliError)
Represents a CLI Error in a Leo Error.
+§CompilerError(CompilerError)
Represents a Compiler Error in a Leo Error.
+§PackageError(PackageError)
Represents a Package Error in a Leo Error.
+§ParserError(ParserError)
Represents a Parser Error in a Leo Error.
§TypeCheckerError(TypeCheckerError)
Represents a Type Checker Error in a Leo Error.
§LoopUnrollerError(LoopUnrollerError)
Represents a Loop Unroller Error in a Leo Error.
§FlattenError(FlattenError)
Represents a Flatten Error in a Leo Error.
§LastErrorCode(i32)
Purely for just exiting with the correct status code and
not re-displaying an error.
-§UtilError(UtilError)
Represents a Utils Error in a Leo Error
+§UtilError(UtilError)
Represents a Utils Error in a Leo Error.
§Anyhow(Error)
Anyhow errors.
Implementations§
source§impl LeoError
sourcepub fn error_code(&self) -> String
Implement error code for each type of Error.
sourcepub fn exit_code(&self) -> i32
Implement exit code for each type of Error.
diff --git a/leo_errors/errors/enum.LeoWarning.html b/leo_errors/errors/enum.LeoWarning.html
index 0faa5539be..c1588d6821 100644
--- a/leo_errors/errors/enum.LeoWarning.html
+++ b/leo_errors/errors/enum.LeoWarning.html
@@ -1,10 +1,10 @@
-LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
+LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
ParserWarning(ParserWarning),
TypeCheckerWarning(TypeCheckerWarning),
-}
Expand description
The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
-Variants§
§ParserWarning(ParserWarning)
Represents an Parser Error in a Leo Error.
-§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Error in a Leo Error.
+}Expand description
The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates.
+Variants§
§ParserWarning(ParserWarning)
Represents an Parser Warning in a Leo Warning.
+§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Warning in a Leo Warning.
Implementations§
source§impl LeoWarning
sourcepub fn error_code(&self) -> String
Implement warning code for each type of Warning.
Trait Implementations§
source§impl Debug for LeoWarning
source§impl Display for LeoWarning
source§impl Error for LeoWarning
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<ParserWarning> for LeoWarning
source§fn from(source: ParserWarning) -> Self
Converts to this type from the input type.source§impl From<TypeCheckerWarning> for LeoWarning
source§fn from(source: TypeCheckerWarning) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for LeoWarning
§impl RefUnwindSafe for LeoWarning
§impl Send for LeoWarning
§impl Sync for LeoWarning
§impl Unpin for LeoWarning
§impl UnwindSafe for LeoWarning
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_errors/errors/index.html b/leo_errors/errors/index.html
index a9aaa3418b..257932bad3 100644
--- a/leo_errors/errors/index.html
+++ b/leo_errors/errors/index.html
@@ -1,4 +1,4 @@
-leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo lang.
+leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo language.
Re-exports§
pub use self::ast::*;
pub use self::cli::*;
pub use self::compiler::*;
pub use self::flattener::*;
pub use self::loop_unroller::*;
pub use self::package::*;
pub use self::parser::*;
pub use self::type_checker::*;
pub use self::utils::*;
Modules§
- Contains the AST error definitions.
- Contains the CLI error definitions.
- Contains the Compiler error definitions.
- Contains the Flattener error definitions.
- Contains the Loop Unroller error definitions.
- Contains the Package error definitions.
- Contains the Parser error definitions.
- Contains the Type Checker error definitions.
- Contains the Utils error definitions.
Enums§
- The LeoError type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
- The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
+This allows a unified error type throughout the Leo crates.The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates. Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
diff --git a/leo_errors/index.html b/leo_errors/index.html
index da14ceb37f..5bbc7ccfbb 100644
--- a/leo_errors/index.html
+++ b/leo_errors/index.html
@@ -46,6 +46,6 @@ §SnarkVM
When SnarkVM implements better error codes and messages, we can bubble them up.
§Utils
The errors related to dependency retrieval in the utils
crate. Its error codes will range from 10_000-10_999 and be prefixed with the characters DEP
.
-
Re-exports§
Modules§
- Contains the common functionalities for defining errors..
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo lang.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
+
Re-exports§
Modules§
- Contains the common functionalities for defining errors.
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo language.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
and error methods generated through a DSL creates and generates errors
with a unique error code.
\ No newline at end of file
diff --git a/leo_package/build/directory/struct.BuildDirectory.html b/leo_package/build/directory/struct.BuildDirectory.html
index fac07569cb..3398708872 100644
--- a/leo_package/build/directory/struct.BuildDirectory.html
+++ b/leo_package/build/directory/struct.BuildDirectory.html
@@ -1,6 +1,6 @@
-BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
source§impl BuildDirectory
sourcepub fn open(path: &Path) -> Result<PathBuf>
Returns the path to the build directory if it exists.
-sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for BuildDirectory
§impl RefUnwindSafe for BuildDirectory
§impl Send for BuildDirectory
§impl Sync for BuildDirectory
§impl Unpin for BuildDirectory
§impl UnwindSafe for BuildDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/fn.parse_file_paths.html b/leo_package/fn.parse_file_paths.html
index 5e8c86b57f..32c80a43ae 100644
--- a/leo_package/fn.parse_file_paths.html
+++ b/leo_package/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package - Rust Function leo_package::parse_file_paths
source · pub(crate) fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/imports/directory/struct.ImportsDirectory.html b/leo_package/imports/directory/struct.ImportsDirectory.html
index f58c759e92..9885ee13dd 100644
--- a/leo_package/imports/directory/struct.ImportsDirectory.html
+++ b/leo_package/imports/directory/struct.ImportsDirectory.html
@@ -1,7 +1,7 @@
-ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name if it does not exist.
-sourcepub fn is_empty(path: &Path) -> Result<bool>
Returns true if the imports directory does not exist or does not contain files.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the imports directory.
+ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
Auto Trait Implementations§
§impl Freeze for ImportsDirectory
§impl RefUnwindSafe for ImportsDirectory
§impl Send for ImportsDirectory
§impl Sync for ImportsDirectory
§impl Unpin for ImportsDirectory
§impl UnwindSafe for ImportsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/inputs/directory/fn.parse_file_paths.html b/leo_package/inputs/directory/fn.parse_file_paths.html
index 1b5a58356c..bbc13fb6c2 100644
--- a/leo_package/inputs/directory/fn.parse_file_paths.html
+++ b/leo_package/inputs/directory/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package::inputs::directory - Rust Function leo_package::inputs::directory::parse_file_paths
source · fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/inputs/directory/struct.InputsDirectory.html b/leo_package/inputs/directory/struct.InputsDirectory.html
index 3be222239e..42e6487029 100644
--- a/leo_package/inputs/directory/struct.InputsDirectory.html
+++ b/leo_package/inputs/directory/struct.InputsDirectory.html
@@ -1,5 +1,5 @@
-InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
source§impl InputsDirectory
sourcepub fn create(path: &Path) -> Result<()>
Creates a directory at the provided path with the default directory name.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the input directory.
+InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for InputsDirectory
§impl RefUnwindSafe for InputsDirectory
§impl Send for InputsDirectory
§impl Sync for InputsDirectory
§impl Unpin for InputsDirectory
§impl UnwindSafe for InputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
index cb29b629d0..fd1493e673 100644
--- a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
+++ b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
@@ -3,8 +3,8 @@
pub snapshot: Snapshot,
}Expand description
Generic Snapshot file wrapper. Each package can have up to 3
different snapshots: initial_ast, canonicalization_ast and type_inferenced_ast;
-Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+
Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn snapshot_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for SnapshotFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for SnapshotFile
§impl RefUnwindSafe for SnapshotFile
§impl Send for SnapshotFile
§impl Sync for SnapshotFile
§impl Unpin for SnapshotFile
§impl UnwindSafe for SnapshotFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/checksum/struct.ChecksumFile.html b/leo_package/outputs/checksum/struct.ChecksumFile.html
index def0ba7fb2..a83b3f87ce 100644
--- a/leo_package/outputs/checksum/struct.ChecksumFile.html
+++ b/leo_package/outputs/checksum/struct.ChecksumFile.html
@@ -1,8 +1,8 @@
ChecksumFile in leo_package::outputs::checksum - Rust Struct leo_package::outputs::checksum::ChecksumFile
source · pub struct ChecksumFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for ChecksumFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ChecksumFile
§impl RefUnwindSafe for ChecksumFile
§impl Send for ChecksumFile
§impl Sync for ChecksumFile
§impl Unpin for ChecksumFile
§impl UnwindSafe for ChecksumFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/circuit/struct.CircuitFile.html b/leo_package/outputs/circuit/struct.CircuitFile.html
index 7a313cccc5..2016ebb713 100644
--- a/leo_package/outputs/circuit/struct.CircuitFile.html
+++ b/leo_package/outputs/circuit/struct.CircuitFile.html
@@ -1,8 +1,8 @@
CircuitFile in leo_package::outputs::circuit - Rust Struct leo_package::outputs::circuit::CircuitFile
source · pub struct CircuitFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for CircuitFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for CircuitFile
§impl RefUnwindSafe for CircuitFile
§impl Send for CircuitFile
§impl Sync for CircuitFile
§impl Unpin for CircuitFile
§impl UnwindSafe for CircuitFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/directory/struct.OutputsDirectory.html b/leo_package/outputs/directory/struct.OutputsDirectory.html
index e6c87e2ceb..eed4aadfb3 100644
--- a/leo_package/outputs/directory/struct.OutputsDirectory.html
+++ b/leo_package/outputs/directory/struct.OutputsDirectory.html
@@ -1,5 +1,5 @@
-OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
source§impl OutputsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for OutputsDirectory
§impl RefUnwindSafe for OutputsDirectory
§impl Send for OutputsDirectory
§impl Sync for OutputsDirectory
§impl Unpin for OutputsDirectory
§impl UnwindSafe for OutputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/package/struct.Package.html b/leo_package/package/struct.Package.html
index 5ddc7ad345..a169387912 100644
--- a/leo_package/package/struct.Package.html
+++ b/leo_package/package/struct.Package.html
@@ -3,8 +3,8 @@
pub version: String,
pub description: Option<String>,
pub license: Option<String>,
- pub network: NetworkName,
-}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
+ pub network: NetworkName,
+}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
Aleo names can only contain ASCII alphanumeric characters and underscores.
sourcepub fn can_initialize(package_name: &str, path: &Path) -> bool
Returns true
if a package is can be initialized at a given path.
Struct leo_compiler::Compiler
source · pub struct Compiler<'a, N: Network> {
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
pub program_name: String,
@@ -9,10 +9,10 @@
node_builder: NodeBuilder,
assigner: Assigner,
type_table: TypeTable,
- import_stubs: IndexMap<Symbol, Stub>,
+ import_stubs: IndexMap<Symbol, Stub>,
phantom: PhantomData<N>,
}
Expand description
The primary entry point of the Leo compiler.
-Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
+Fields§
§handler: &'a Handler
The handler is used for error and warning emissions.
main_file_path: PathBuf
The path to the main leo file.
output_directory: PathBuf
The path to where the compiler outputs all generated files.
program_name: String
The program name,
@@ -22,57 +22,57 @@node_builder: NodeBuilder
The NodeCounter
used to generate sequentially increasing NodeID
s.
assigner: Assigner
The Assigner
is used to construct (unique) assignment statements.
type_table: TypeTable
The type table.
-import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
import_stubs: IndexMap<Symbol, Stub>
The stubs for imported programs. Produced by Retriever
module.
phantom: PhantomData<N>
Implementations§
source§impl<'a, N: Network> Compiler<'a, N>
impl<'a, N: Network> Compiler<'a, N>
sourcepub fn new(
program_name: String,
network: String,
- handler: &'a Handler,
+ handler: &'a Handler,
main_file_path: PathBuf,
output_directory: PathBuf,
compiler_options: Option<CompilerOptions>,
- import_stubs: IndexMap<Symbol, Stub>
+ import_stubs: IndexMap<Symbol, Stub>
) -> Self
pub fn new( program_name: String, network: String, - handler: &'a Handler, + handler: &'a Handler, main_file_path: PathBuf, output_directory: PathBuf, compiler_options: Option<CompilerOptions>, - import_stubs: IndexMap<Symbol, Stub> + import_stubs: IndexMap<Symbol, Stub> ) -> Self
Returns a new Leo compiler.
-sourcepub fn parse_program_from_string(
&mut self,
program_string: &str,
- name: FileName
-) -> Result<()>
pub fn parse_program_from_string( &mut self, program_string: &str, - name: FileName -) -> Result<()>
Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
-sourcepub fn parse_program(&mut self) -> Result<()>
pub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
-sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
pub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
+ name: FileName +) -> Result<()>Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.
+sourcepub fn parse_program(&mut self) -> Result<()>
pub fn parse_program(&mut self) -> Result<()>
Parses and stores the main program file, constructs a syntax tree, and generates a program.
+sourcepub fn symbol_table_pass(&self) -> Result<SymbolTable>
pub fn symbol_table_pass(&self) -> Result<SymbolTable>
Runs the symbol table pass.
sourcepub fn type_checker_pass(
&'a self,
symbol_table: SymbolTable
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
pub fn type_checker_pass( &'a self, symbol_table: SymbolTable -) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the type checker pass.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the type checker pass.
sourcepub fn loop_unrolling_pass(
&mut self,
symbol_table: SymbolTable
-) -> Result<SymbolTable>
pub fn loop_unrolling_pass( &mut self, symbol_table: SymbolTable -) -> Result<SymbolTable>
Runs the loop unrolling pass.
+) -> Result<SymbolTable>Runs the loop unrolling pass.
sourcepub fn static_single_assignment_pass(
&mut self,
symbol_table: &SymbolTable
-) -> Result<()>
pub fn static_single_assignment_pass( &mut self, symbol_table: &SymbolTable -) -> Result<()>
Runs the static single assignment pass.
-sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
pub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
-sourcepub fn destructuring_pass(&mut self) -> Result<()>
pub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
-sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
pub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
-sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
pub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
+) -> Result<()>Runs the static single assignment pass.
+sourcepub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
pub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>
Runs the flattening pass.
+sourcepub fn destructuring_pass(&mut self) -> Result<()>
pub fn destructuring_pass(&mut self) -> Result<()>
Runs the destructuring pass.
+sourcepub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
pub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>
Runs the function inlining pass.
+sourcepub fn dead_code_elimination_pass(&mut self) -> Result<()>
pub fn dead_code_elimination_pass(&mut self) -> Result<()>
Runs the dead code elimination pass.
sourcepub fn code_generation_pass(
&mut self,
symbol_table: &SymbolTable,
struct_graph: &StructGraph,
call_graph: &CallGraph
-) -> Result<String>
pub fn code_generation_pass( &mut self, symbol_table: &SymbolTable, struct_graph: &StructGraph, call_graph: &CallGraph -) -> Result<String>
Runs the code generation pass.
+) -> Result<String>Runs the code generation pass.
sourcepub fn compiler_stages(
&mut self
-) -> Result<(SymbolTable, StructGraph, CallGraph)>
pub fn compiler_stages( &mut self -) -> Result<(SymbolTable, StructGraph, CallGraph)>
Runs the compiler stages.
-sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
fn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
+) -> Result<(SymbolTable, StructGraph, CallGraph)>Runs the compiler stages.
+sourcefn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
fn write_ast_to_json(&self, file_suffix: &str) -> Result<()>
Writes the AST to a JSON file.
sourcefn write_symbol_table_to_json(
&self,
file_suffix: &str,
symbol_table: &SymbolTable
-) -> Result<()>
fn write_symbol_table_to_json( &self, file_suffix: &str, symbol_table: &SymbolTable -) -> Result<()>
Writes the Symbol Table to a JSON file.
-sourcepub fn add_import_stubs(&mut self) -> Result<()>
pub fn add_import_stubs(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl<'a, N> !Freeze for Compiler<'a, N>
impl<'a, N> !RefUnwindSafe for Compiler<'a, N>
impl<'a, N> !Send for Compiler<'a, N>
impl<'a, N> !Sync for Compiler<'a, N>
impl<'a, N> Unpin for Compiler<'a, N>where
N: Unpin,
impl<'a, N> !UnwindSafe for Compiler<'a, N>
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_compiler/struct.SymbolTable.html b/leo_compiler/struct.SymbolTable.html
index abd12cc7c0..cf23f3f321 100644
--- a/leo_compiler/struct.SymbolTable.html
+++ b/leo_compiler/struct.SymbolTable.html
@@ -13,8 +13,8 @@
&self,
location: &Location,
is_struct: bool,
- span: Span
-) -> Result<(), LeoError>Recursively checks if the symbol table contains an entry for the given symbol.
+ span: Span
+) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol.
Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
Returns the current scope index.
Increments the scope index.
@@ -22,35 +22,35 @@
&mut self,
location: Location,
insert: &Function
-) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
-sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SymbolTable
source§impl Default for SymbolTable
source§fn default() -> SymbolTable
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_disassembler/fn.disassemble_from_str.html b/leo_disassembler/fn.disassemble_from_str.html
index 0dc23c5ffd..73dd2bcdf6 100644
--- a/leo_disassembler/fn.disassemble_from_str.html
+++ b/leo_disassembler/fn.disassemble_from_str.html
@@ -1,4 +1,4 @@
disassemble_from_str in leo_disassembler - Rust Function leo_disassembler::disassemble_from_str
source · pub fn disassemble_from_str<N: Network>(
name: &str,
program: &str
-) -> Result<Stub, UtilError>
\ No newline at end of file
+) -> Result<Stub, UtilError>
\ No newline at end of file
diff --git a/leo_errors/common/index.html b/leo_errors/common/index.html
index 9823564797..7349584cbe 100644
--- a/leo_errors/common/index.html
+++ b/leo_errors/common/index.html
@@ -1,2 +1,2 @@
-leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors..
+leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors.
Re-exports§
pub use self::backtraced::*;
pub use self::formatted::*;
pub use self::traits::*;
Modules§
- This module contains a backtraced error and its methods.
- This module contains a formatted error and its methods.
- This module contains the macros for making errors easily.
- This module contains traits for making errors easily.
\ No newline at end of file
diff --git a/leo_errors/errors/enum.LeoError.html b/leo_errors/errors/enum.LeoError.html
index 14a74cc5b9..8ec7a32fc3 100644
--- a/leo_errors/errors/enum.LeoError.html
+++ b/leo_errors/errors/enum.LeoError.html
@@ -13,16 +13,16 @@
}Expand description
The LeoError type that contains all sub error types.
This allows a unified error type throughout the Leo crates.
Variants§
§AstError(AstError)
Represents an AST Error in a Leo Error.
-§CliError(CliError)
Represents an CLI Error in a Leo Error.
-§CompilerError(CompilerError)
Represents an Compiler Error in a Leo Error.
-§PackageError(PackageError)
Represents an Package Error in a Leo Error.
-§ParserError(ParserError)
Represents an Parser Error in a Leo Error.
+§CliError(CliError)
Represents a CLI Error in a Leo Error.
+§CompilerError(CompilerError)
Represents a Compiler Error in a Leo Error.
+§PackageError(PackageError)
Represents a Package Error in a Leo Error.
+§ParserError(ParserError)
Represents a Parser Error in a Leo Error.
§TypeCheckerError(TypeCheckerError)
Represents a Type Checker Error in a Leo Error.
§LoopUnrollerError(LoopUnrollerError)
Represents a Loop Unroller Error in a Leo Error.
§FlattenError(FlattenError)
Represents a Flatten Error in a Leo Error.
§LastErrorCode(i32)
Purely for just exiting with the correct status code and
not re-displaying an error.
-§UtilError(UtilError)
Represents a Utils Error in a Leo Error
+§UtilError(UtilError)
Represents a Utils Error in a Leo Error.
§Anyhow(Error)
Anyhow errors.
Implementations§
source§impl LeoError
sourcepub fn error_code(&self) -> String
Implement error code for each type of Error.
sourcepub fn exit_code(&self) -> i32
Implement exit code for each type of Error.
diff --git a/leo_errors/errors/enum.LeoWarning.html b/leo_errors/errors/enum.LeoWarning.html
index 0faa5539be..c1588d6821 100644
--- a/leo_errors/errors/enum.LeoWarning.html
+++ b/leo_errors/errors/enum.LeoWarning.html
@@ -1,10 +1,10 @@
-LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
+LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
ParserWarning(ParserWarning),
TypeCheckerWarning(TypeCheckerWarning),
-}
Expand description
The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
-Variants§
§ParserWarning(ParserWarning)
Represents an Parser Error in a Leo Error.
-§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Error in a Leo Error.
+}Expand description
The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates.
+Variants§
§ParserWarning(ParserWarning)
Represents an Parser Warning in a Leo Warning.
+§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Warning in a Leo Warning.
Implementations§
source§impl LeoWarning
sourcepub fn error_code(&self) -> String
Implement warning code for each type of Warning.
Trait Implementations§
source§impl Debug for LeoWarning
source§impl Display for LeoWarning
source§impl Error for LeoWarning
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<ParserWarning> for LeoWarning
source§fn from(source: ParserWarning) -> Self
Converts to this type from the input type.source§impl From<TypeCheckerWarning> for LeoWarning
source§fn from(source: TypeCheckerWarning) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for LeoWarning
§impl RefUnwindSafe for LeoWarning
§impl Send for LeoWarning
§impl Sync for LeoWarning
§impl Unpin for LeoWarning
§impl UnwindSafe for LeoWarning
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_errors/errors/index.html b/leo_errors/errors/index.html
index a9aaa3418b..257932bad3 100644
--- a/leo_errors/errors/index.html
+++ b/leo_errors/errors/index.html
@@ -1,4 +1,4 @@
-leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo lang.
+leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo language.
Re-exports§
pub use self::ast::*;
pub use self::cli::*;
pub use self::compiler::*;
pub use self::flattener::*;
pub use self::loop_unroller::*;
pub use self::package::*;
pub use self::parser::*;
pub use self::type_checker::*;
pub use self::utils::*;
Modules§
- Contains the AST error definitions.
- Contains the CLI error definitions.
- Contains the Compiler error definitions.
- Contains the Flattener error definitions.
- Contains the Loop Unroller error definitions.
- Contains the Package error definitions.
- Contains the Parser error definitions.
- Contains the Type Checker error definitions.
- Contains the Utils error definitions.
Enums§
- The LeoError type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
- The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
+This allows a unified error type throughout the Leo crates.The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates. Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
diff --git a/leo_errors/index.html b/leo_errors/index.html
index da14ceb37f..5bbc7ccfbb 100644
--- a/leo_errors/index.html
+++ b/leo_errors/index.html
@@ -46,6 +46,6 @@ §SnarkVM
When SnarkVM implements better error codes and messages, we can bubble them up.
§Utils
The errors related to dependency retrieval in the utils
crate. Its error codes will range from 10_000-10_999 and be prefixed with the characters DEP
.
-
Re-exports§
Modules§
- Contains the common functionalities for defining errors..
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo lang.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
+
Re-exports§
Modules§
- Contains the common functionalities for defining errors.
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo language.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
and error methods generated through a DSL creates and generates errors
with a unique error code.
\ No newline at end of file
diff --git a/leo_package/build/directory/struct.BuildDirectory.html b/leo_package/build/directory/struct.BuildDirectory.html
index fac07569cb..3398708872 100644
--- a/leo_package/build/directory/struct.BuildDirectory.html
+++ b/leo_package/build/directory/struct.BuildDirectory.html
@@ -1,6 +1,6 @@
-BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
source§impl BuildDirectory
sourcepub fn open(path: &Path) -> Result<PathBuf>
Returns the path to the build directory if it exists.
-sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for BuildDirectory
§impl RefUnwindSafe for BuildDirectory
§impl Send for BuildDirectory
§impl Sync for BuildDirectory
§impl Unpin for BuildDirectory
§impl UnwindSafe for BuildDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/fn.parse_file_paths.html b/leo_package/fn.parse_file_paths.html
index 5e8c86b57f..32c80a43ae 100644
--- a/leo_package/fn.parse_file_paths.html
+++ b/leo_package/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package - Rust Function leo_package::parse_file_paths
source · pub(crate) fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/imports/directory/struct.ImportsDirectory.html b/leo_package/imports/directory/struct.ImportsDirectory.html
index f58c759e92..9885ee13dd 100644
--- a/leo_package/imports/directory/struct.ImportsDirectory.html
+++ b/leo_package/imports/directory/struct.ImportsDirectory.html
@@ -1,7 +1,7 @@
-ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name if it does not exist.
-sourcepub fn is_empty(path: &Path) -> Result<bool>
Returns true if the imports directory does not exist or does not contain files.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the imports directory.
+ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
Auto Trait Implementations§
§impl Freeze for ImportsDirectory
§impl RefUnwindSafe for ImportsDirectory
§impl Send for ImportsDirectory
§impl Sync for ImportsDirectory
§impl Unpin for ImportsDirectory
§impl UnwindSafe for ImportsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/inputs/directory/fn.parse_file_paths.html b/leo_package/inputs/directory/fn.parse_file_paths.html
index 1b5a58356c..bbc13fb6c2 100644
--- a/leo_package/inputs/directory/fn.parse_file_paths.html
+++ b/leo_package/inputs/directory/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package::inputs::directory - Rust Function leo_package::inputs::directory::parse_file_paths
source · fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/inputs/directory/struct.InputsDirectory.html b/leo_package/inputs/directory/struct.InputsDirectory.html
index 3be222239e..42e6487029 100644
--- a/leo_package/inputs/directory/struct.InputsDirectory.html
+++ b/leo_package/inputs/directory/struct.InputsDirectory.html
@@ -1,5 +1,5 @@
-InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
source§impl InputsDirectory
sourcepub fn create(path: &Path) -> Result<()>
Creates a directory at the provided path with the default directory name.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the input directory.
+InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for InputsDirectory
§impl RefUnwindSafe for InputsDirectory
§impl Send for InputsDirectory
§impl Sync for InputsDirectory
§impl Unpin for InputsDirectory
§impl UnwindSafe for InputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
index cb29b629d0..fd1493e673 100644
--- a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
+++ b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
@@ -3,8 +3,8 @@
pub snapshot: Snapshot,
}Expand description
Generic Snapshot file wrapper. Each package can have up to 3
different snapshots: initial_ast, canonicalization_ast and type_inferenced_ast;
-Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+
Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn snapshot_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for SnapshotFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for SnapshotFile
§impl RefUnwindSafe for SnapshotFile
§impl Send for SnapshotFile
§impl Sync for SnapshotFile
§impl Unpin for SnapshotFile
§impl UnwindSafe for SnapshotFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/checksum/struct.ChecksumFile.html b/leo_package/outputs/checksum/struct.ChecksumFile.html
index def0ba7fb2..a83b3f87ce 100644
--- a/leo_package/outputs/checksum/struct.ChecksumFile.html
+++ b/leo_package/outputs/checksum/struct.ChecksumFile.html
@@ -1,8 +1,8 @@
ChecksumFile in leo_package::outputs::checksum - Rust Struct leo_package::outputs::checksum::ChecksumFile
source · pub struct ChecksumFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for ChecksumFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ChecksumFile
§impl RefUnwindSafe for ChecksumFile
§impl Send for ChecksumFile
§impl Sync for ChecksumFile
§impl Unpin for ChecksumFile
§impl UnwindSafe for ChecksumFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/circuit/struct.CircuitFile.html b/leo_package/outputs/circuit/struct.CircuitFile.html
index 7a313cccc5..2016ebb713 100644
--- a/leo_package/outputs/circuit/struct.CircuitFile.html
+++ b/leo_package/outputs/circuit/struct.CircuitFile.html
@@ -1,8 +1,8 @@
CircuitFile in leo_package::outputs::circuit - Rust Struct leo_package::outputs::circuit::CircuitFile
source · pub struct CircuitFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for CircuitFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for CircuitFile
§impl RefUnwindSafe for CircuitFile
§impl Send for CircuitFile
§impl Sync for CircuitFile
§impl Unpin for CircuitFile
§impl UnwindSafe for CircuitFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/directory/struct.OutputsDirectory.html b/leo_package/outputs/directory/struct.OutputsDirectory.html
index e6c87e2ceb..eed4aadfb3 100644
--- a/leo_package/outputs/directory/struct.OutputsDirectory.html
+++ b/leo_package/outputs/directory/struct.OutputsDirectory.html
@@ -1,5 +1,5 @@
-OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
source§impl OutputsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for OutputsDirectory
§impl RefUnwindSafe for OutputsDirectory
§impl Send for OutputsDirectory
§impl Sync for OutputsDirectory
§impl Unpin for OutputsDirectory
§impl UnwindSafe for OutputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/package/struct.Package.html b/leo_package/package/struct.Package.html
index 5ddc7ad345..a169387912 100644
--- a/leo_package/package/struct.Package.html
+++ b/leo_package/package/struct.Package.html
@@ -3,8 +3,8 @@
pub version: String,
pub description: Option<String>,
pub license: Option<String>,
- pub network: NetworkName,
-}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
+ pub network: NetworkName,
+}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
Aleo names can only contain ASCII alphanumeric characters and underscores.
sourcepub fn can_initialize(package_name: &str, path: &Path) -> bool
Returns true
if a package is can be initialized at a given path.
impl<T> Borrow<T> for Twhere
diff --git a/leo_compiler/struct.SymbolTable.html b/leo_compiler/struct.SymbolTable.html
index abd12cc7c0..cf23f3f321 100644
--- a/leo_compiler/struct.SymbolTable.html
+++ b/leo_compiler/struct.SymbolTable.html
@@ -13,8 +13,8 @@
&self,
location: &Location,
is_struct: bool,
- span: Span
-) -> Result<(), LeoError>Recursively checks if the symbol table contains an entry for the given symbol.
+ span: Span
+) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol.
Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
Returns the current scope index.
Increments the scope index.
@@ -22,35 +22,35 @@
&mut self,
location: Location,
insert: &Function
-) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
-sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
sourcepub fn to_json_file(
&self,
path: PathBuf,
file_name: &str
-) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SymbolTable
source§impl Default for SymbolTable
source§fn default() -> SymbolTable
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_disassembler/fn.disassemble_from_str.html b/leo_disassembler/fn.disassemble_from_str.html
index 0dc23c5ffd..73dd2bcdf6 100644
--- a/leo_disassembler/fn.disassemble_from_str.html
+++ b/leo_disassembler/fn.disassemble_from_str.html
@@ -1,4 +1,4 @@
disassemble_from_str in leo_disassembler - Rust Function leo_disassembler::disassemble_from_str
source · pub fn disassemble_from_str<N: Network>(
name: &str,
program: &str
-) -> Result<Stub, UtilError>
\ No newline at end of file
+) -> Result<Stub, UtilError>
\ No newline at end of file
diff --git a/leo_errors/common/index.html b/leo_errors/common/index.html
index 9823564797..7349584cbe 100644
--- a/leo_errors/common/index.html
+++ b/leo_errors/common/index.html
@@ -1,2 +1,2 @@
-leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors..
+leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors.
Re-exports§
pub use self::backtraced::*;
pub use self::formatted::*;
pub use self::traits::*;
Modules§
- This module contains a backtraced error and its methods.
- This module contains a formatted error and its methods.
- This module contains the macros for making errors easily.
- This module contains traits for making errors easily.
\ No newline at end of file
diff --git a/leo_errors/errors/enum.LeoError.html b/leo_errors/errors/enum.LeoError.html
index 14a74cc5b9..8ec7a32fc3 100644
--- a/leo_errors/errors/enum.LeoError.html
+++ b/leo_errors/errors/enum.LeoError.html
@@ -13,16 +13,16 @@
}Expand description
The LeoError type that contains all sub error types.
This allows a unified error type throughout the Leo crates.
Variants§
§AstError(AstError)
Represents an AST Error in a Leo Error.
-§CliError(CliError)
Represents an CLI Error in a Leo Error.
-§CompilerError(CompilerError)
Represents an Compiler Error in a Leo Error.
-§PackageError(PackageError)
Represents an Package Error in a Leo Error.
-§ParserError(ParserError)
Represents an Parser Error in a Leo Error.
+§CliError(CliError)
Represents a CLI Error in a Leo Error.
+§CompilerError(CompilerError)
Represents a Compiler Error in a Leo Error.
+§PackageError(PackageError)
Represents a Package Error in a Leo Error.
+§ParserError(ParserError)
Represents a Parser Error in a Leo Error.
§TypeCheckerError(TypeCheckerError)
Represents a Type Checker Error in a Leo Error.
§LoopUnrollerError(LoopUnrollerError)
Represents a Loop Unroller Error in a Leo Error.
§FlattenError(FlattenError)
Represents a Flatten Error in a Leo Error.
§LastErrorCode(i32)
Purely for just exiting with the correct status code and
not re-displaying an error.
-§UtilError(UtilError)
Represents a Utils Error in a Leo Error
+§UtilError(UtilError)
Represents a Utils Error in a Leo Error.
§Anyhow(Error)
Anyhow errors.
Implementations§
source§impl LeoError
sourcepub fn error_code(&self) -> String
Implement error code for each type of Error.
sourcepub fn exit_code(&self) -> i32
Implement exit code for each type of Error.
diff --git a/leo_errors/errors/enum.LeoWarning.html b/leo_errors/errors/enum.LeoWarning.html
index 0faa5539be..c1588d6821 100644
--- a/leo_errors/errors/enum.LeoWarning.html
+++ b/leo_errors/errors/enum.LeoWarning.html
@@ -1,10 +1,10 @@
-LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
+LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
ParserWarning(ParserWarning),
TypeCheckerWarning(TypeCheckerWarning),
-}
Expand description
The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
-Variants§
§ParserWarning(ParserWarning)
Represents an Parser Error in a Leo Error.
-§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Error in a Leo Error.
+}Expand description
The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates.
+Variants§
§ParserWarning(ParserWarning)
Represents an Parser Warning in a Leo Warning.
+§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Warning in a Leo Warning.
Implementations§
source§impl LeoWarning
sourcepub fn error_code(&self) -> String
Implement warning code for each type of Warning.
Trait Implementations§
source§impl Debug for LeoWarning
source§impl Display for LeoWarning
source§impl Error for LeoWarning
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<ParserWarning> for LeoWarning
source§fn from(source: ParserWarning) -> Self
Converts to this type from the input type.source§impl From<TypeCheckerWarning> for LeoWarning
source§fn from(source: TypeCheckerWarning) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for LeoWarning
§impl RefUnwindSafe for LeoWarning
§impl Send for LeoWarning
§impl Sync for LeoWarning
§impl Unpin for LeoWarning
§impl UnwindSafe for LeoWarning
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_errors/errors/index.html b/leo_errors/errors/index.html
index a9aaa3418b..257932bad3 100644
--- a/leo_errors/errors/index.html
+++ b/leo_errors/errors/index.html
@@ -1,4 +1,4 @@
-leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo lang.
+leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo language.
Re-exports§
pub use self::ast::*;
pub use self::cli::*;
pub use self::compiler::*;
pub use self::flattener::*;
pub use self::loop_unroller::*;
pub use self::package::*;
pub use self::parser::*;
pub use self::type_checker::*;
pub use self::utils::*;
Modules§
- Contains the AST error definitions.
- Contains the CLI error definitions.
- Contains the Compiler error definitions.
- Contains the Flattener error definitions.
- Contains the Loop Unroller error definitions.
- Contains the Package error definitions.
- Contains the Parser error definitions.
- Contains the Type Checker error definitions.
- Contains the Utils error definitions.
Enums§
- The LeoError type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
- The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
+This allows a unified error type throughout the Leo crates.The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates. Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
diff --git a/leo_errors/index.html b/leo_errors/index.html
index da14ceb37f..5bbc7ccfbb 100644
--- a/leo_errors/index.html
+++ b/leo_errors/index.html
@@ -46,6 +46,6 @@ §SnarkVM
When SnarkVM implements better error codes and messages, we can bubble them up.
§Utils
The errors related to dependency retrieval in the utils
crate. Its error codes will range from 10_000-10_999 and be prefixed with the characters DEP
.
-
Re-exports§
Modules§
- Contains the common functionalities for defining errors..
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo lang.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
+
Re-exports§
Modules§
- Contains the common functionalities for defining errors.
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo language.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
and error methods generated through a DSL creates and generates errors
with a unique error code.
\ No newline at end of file
diff --git a/leo_package/build/directory/struct.BuildDirectory.html b/leo_package/build/directory/struct.BuildDirectory.html
index fac07569cb..3398708872 100644
--- a/leo_package/build/directory/struct.BuildDirectory.html
+++ b/leo_package/build/directory/struct.BuildDirectory.html
@@ -1,6 +1,6 @@
-BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
source§impl BuildDirectory
sourcepub fn open(path: &Path) -> Result<PathBuf>
Returns the path to the build directory if it exists.
-sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for BuildDirectory
§impl RefUnwindSafe for BuildDirectory
§impl Send for BuildDirectory
§impl Sync for BuildDirectory
§impl Unpin for BuildDirectory
§impl UnwindSafe for BuildDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/fn.parse_file_paths.html b/leo_package/fn.parse_file_paths.html
index 5e8c86b57f..32c80a43ae 100644
--- a/leo_package/fn.parse_file_paths.html
+++ b/leo_package/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package - Rust Function leo_package::parse_file_paths
source · pub(crate) fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/imports/directory/struct.ImportsDirectory.html b/leo_package/imports/directory/struct.ImportsDirectory.html
index f58c759e92..9885ee13dd 100644
--- a/leo_package/imports/directory/struct.ImportsDirectory.html
+++ b/leo_package/imports/directory/struct.ImportsDirectory.html
@@ -1,7 +1,7 @@
-ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name if it does not exist.
-sourcepub fn is_empty(path: &Path) -> Result<bool>
Returns true if the imports directory does not exist or does not contain files.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the imports directory.
+ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
Auto Trait Implementations§
§impl Freeze for ImportsDirectory
§impl RefUnwindSafe for ImportsDirectory
§impl Send for ImportsDirectory
§impl Sync for ImportsDirectory
§impl Unpin for ImportsDirectory
§impl UnwindSafe for ImportsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/inputs/directory/fn.parse_file_paths.html b/leo_package/inputs/directory/fn.parse_file_paths.html
index 1b5a58356c..bbc13fb6c2 100644
--- a/leo_package/inputs/directory/fn.parse_file_paths.html
+++ b/leo_package/inputs/directory/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package::inputs::directory - Rust Function leo_package::inputs::directory::parse_file_paths
source · fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/inputs/directory/struct.InputsDirectory.html b/leo_package/inputs/directory/struct.InputsDirectory.html
index 3be222239e..42e6487029 100644
--- a/leo_package/inputs/directory/struct.InputsDirectory.html
+++ b/leo_package/inputs/directory/struct.InputsDirectory.html
@@ -1,5 +1,5 @@
-InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
source§impl InputsDirectory
sourcepub fn create(path: &Path) -> Result<()>
Creates a directory at the provided path with the default directory name.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the input directory.
+InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for InputsDirectory
§impl RefUnwindSafe for InputsDirectory
§impl Send for InputsDirectory
§impl Sync for InputsDirectory
§impl Unpin for InputsDirectory
§impl UnwindSafe for InputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
index cb29b629d0..fd1493e673 100644
--- a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
+++ b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
@@ -3,8 +3,8 @@
pub snapshot: Snapshot,
}Expand description
Generic Snapshot file wrapper. Each package can have up to 3
different snapshots: initial_ast, canonicalization_ast and type_inferenced_ast;
-Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+
Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn snapshot_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for SnapshotFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for SnapshotFile
§impl RefUnwindSafe for SnapshotFile
§impl Send for SnapshotFile
§impl Sync for SnapshotFile
§impl Unpin for SnapshotFile
§impl UnwindSafe for SnapshotFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/checksum/struct.ChecksumFile.html b/leo_package/outputs/checksum/struct.ChecksumFile.html
index def0ba7fb2..a83b3f87ce 100644
--- a/leo_package/outputs/checksum/struct.ChecksumFile.html
+++ b/leo_package/outputs/checksum/struct.ChecksumFile.html
@@ -1,8 +1,8 @@
ChecksumFile in leo_package::outputs::checksum - Rust Struct leo_package::outputs::checksum::ChecksumFile
source · pub struct ChecksumFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for ChecksumFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ChecksumFile
§impl RefUnwindSafe for ChecksumFile
§impl Send for ChecksumFile
§impl Sync for ChecksumFile
§impl Unpin for ChecksumFile
§impl UnwindSafe for ChecksumFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/circuit/struct.CircuitFile.html b/leo_package/outputs/circuit/struct.CircuitFile.html
index 7a313cccc5..2016ebb713 100644
--- a/leo_package/outputs/circuit/struct.CircuitFile.html
+++ b/leo_package/outputs/circuit/struct.CircuitFile.html
@@ -1,8 +1,8 @@
CircuitFile in leo_package::outputs::circuit - Rust Struct leo_package::outputs::circuit::CircuitFile
source · pub struct CircuitFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for CircuitFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for CircuitFile
§impl RefUnwindSafe for CircuitFile
§impl Send for CircuitFile
§impl Sync for CircuitFile
§impl Unpin for CircuitFile
§impl UnwindSafe for CircuitFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/directory/struct.OutputsDirectory.html b/leo_package/outputs/directory/struct.OutputsDirectory.html
index e6c87e2ceb..eed4aadfb3 100644
--- a/leo_package/outputs/directory/struct.OutputsDirectory.html
+++ b/leo_package/outputs/directory/struct.OutputsDirectory.html
@@ -1,5 +1,5 @@
-OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
source§impl OutputsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for OutputsDirectory
§impl RefUnwindSafe for OutputsDirectory
§impl Send for OutputsDirectory
§impl Sync for OutputsDirectory
§impl Unpin for OutputsDirectory
§impl UnwindSafe for OutputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/package/struct.Package.html b/leo_package/package/struct.Package.html
index 5ddc7ad345..a169387912 100644
--- a/leo_package/package/struct.Package.html
+++ b/leo_package/package/struct.Package.html
@@ -3,8 +3,8 @@
pub version: String,
pub description: Option<String>,
pub license: Option<String>,
- pub network: NetworkName,
-}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
+ pub network: NetworkName,
+}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
Aleo names can only contain ASCII alphanumeric characters and underscores.
sourcepub fn can_initialize(package_name: &str, path: &Path) -> bool
Returns true
if a package is can be initialized at a given path.
Recursively checks if the symbol table contains an entry for the given symbol. + span: Span +) -> Result<(), LeoError>
Recursively checks if the symbol table contains an entry for the given symbol. Leo does not allow any variable shadowing or overlap between different symbols.
sourcepub fn scope_index(&mut self) -> usize
pub fn scope_index(&mut self) -> usize
Returns the current scope index. Increments the scope index.
@@ -22,35 +22,35 @@ &mut self, location: Location, insert: &Function -) -> Result<(), LeoError>Inserts a function into the symbol table.
+) -> Result<(), LeoError>Inserts a function into the symbol table.
sourcepub fn insert_struct(
&mut self,
location: Location,
insert: &Composite
-) -> Result<(), LeoError>
pub fn insert_struct( &mut self, location: Location, insert: &Composite -) -> Result<(), LeoError>
Inserts a struct into the symbol table.
+) -> Result<(), LeoError>Inserts a struct into the symbol table.
sourcepub fn attach_finalize(
&mut self,
caller: Location,
callee: Location
-) -> Result<(), LeoError>
pub fn attach_finalize( &mut self, caller: Location, callee: Location -) -> Result<(), LeoError>
Attach a finalize to a function.
+) -> Result<(), LeoError>Attach a finalize to a function.
sourcepub fn insert_variable(
&mut self,
location: Location,
insert: VariableSymbol
-) -> Result<(), LeoError>
pub fn insert_variable( &mut self, location: Location, insert: VariableSymbol -) -> Result<(), LeoError>
Inserts a variable into the symbol table.
+) -> Result<(), LeoError>Inserts a variable into the symbol table.
sourcepub fn insert_futures(
&mut self,
- program: Symbol,
- function: Symbol,
+ program: Symbol,
+ function: Symbol,
futures: Vec<Location>
-) -> Result<(), LeoError>
pub fn insert_futures( &mut self, - program: Symbol, - function: Symbol, + program: Symbol, + function: Symbol, futures: Vec<Location> -) -> Result<(), LeoError>
Inserts futures into the function definition.
+) -> Result<(), LeoError>Inserts futures into the function definition.
sourcepub fn remove_variable_from_current_scope(&mut self, location: Location)
pub fn remove_variable_from_current_scope(&mut self, location: Location)
Removes a variable from the symbol table.
sourcepub fn insert_block(&mut self) -> usize
pub fn insert_block(&mut self) -> usize
Creates a new scope for the block and stores it in the symbol table.
sourcepub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
pub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>
Attempts to lookup a function in the symbol table.
sourcepub fn lookup_struct(
&self,
location: Location,
- main_program: Option<Symbol>
+ main_program: Option<Symbol>
) -> Option<&Composite>
pub fn lookup_struct( &self, location: Location, - main_program: Option<Symbol> + main_program: Option<Symbol> ) -> Option<&Composite>
Attempts to lookup a struct in the symbol table.
sourcepub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
pub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>
Attempts to lookup a variable in the symbol table.
sourcepub fn lookup_variable_in_current_scope(
@@ -61,20 +61,20 @@
&self,
index: usize
) -> Option<&RefCell<SymbolTable>>
pub fn lookup_variable_in_current_scope( @@ -61,20 +61,20 @@ &self, index: usize ) -> Option<&RefCell<SymbolTable>>
Returns the scope associated with index
, if it exists in the symbol table.
sourcepub fn to_json_string(&self) -> Result<String, LeoError>
pub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
-sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
pub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
+sourcepub fn to_json_string(&self) -> Result<String, LeoError>
pub fn to_json_string(&self) -> Result<String, LeoError>
Serializes the symbol table into a JSON string.
+sourcepub fn to_json_value(&self) -> Result<Value, LeoError>
pub fn to_json_value(&self) -> Result<Value, LeoError>
Converts the symbol table into a JSON value
pub fn to_json_file( &self, path: PathBuf, file_name: &str -) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
+) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
pub fn to_json_file_without_keys( +) -> Result<(), LeoError>
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
-) -> Result<(), LeoError>
pub fn to_json_file_without_keys( &self, path: PathBuf, file_name: &str, excluded_keys: &[&str] -) -> Result<(), LeoError>
Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
-sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
pub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
-sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
pub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
+) -> Result<(), LeoError>Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.
+sourcepub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
pub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table.
+sourcepub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
pub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>
Deserializes the JSON string into a symbol table from a file.
Trait Implementations§
source§impl Clone for SymbolTable
impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
fn clone(&self) -> SymbolTable
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SymbolTable
impl Debug for SymbolTable
source§impl Default for SymbolTable
impl Default for SymbolTable
source§fn default() -> SymbolTable
fn default() -> SymbolTable
source§impl<'de> Deserialize<'de> for SymbolTable
impl<'de> Deserialize<'de> for SymbolTable
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_disassembler/fn.disassemble_from_str.html b/leo_disassembler/fn.disassemble_from_str.html
index 0dc23c5ffd..73dd2bcdf6 100644
--- a/leo_disassembler/fn.disassemble_from_str.html
+++ b/leo_disassembler/fn.disassemble_from_str.html
@@ -1,4 +1,4 @@
disassemble_from_str in leo_disassembler - Rust Function leo_disassembler::disassemble_from_str
source · pub fn disassemble_from_str<N: Network>(
name: &str,
program: &str
-) -> Result<Stub, UtilError>
\ No newline at end of file
+) -> Result<Stub, UtilError>
\ No newline at end of file
diff --git a/leo_errors/common/index.html b/leo_errors/common/index.html
index 9823564797..7349584cbe 100644
--- a/leo_errors/common/index.html
+++ b/leo_errors/common/index.html
@@ -1,2 +1,2 @@
-leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors..
+leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors.
Re-exports§
pub use self::backtraced::*;
pub use self::formatted::*;
pub use self::traits::*;
Modules§
- This module contains a backtraced error and its methods.
- This module contains a formatted error and its methods.
- This module contains the macros for making errors easily.
- This module contains traits for making errors easily.
\ No newline at end of file
diff --git a/leo_errors/errors/enum.LeoError.html b/leo_errors/errors/enum.LeoError.html
index 14a74cc5b9..8ec7a32fc3 100644
--- a/leo_errors/errors/enum.LeoError.html
+++ b/leo_errors/errors/enum.LeoError.html
@@ -13,16 +13,16 @@
}Expand description
The LeoError type that contains all sub error types.
This allows a unified error type throughout the Leo crates.
Variants§
§AstError(AstError)
Represents an AST Error in a Leo Error.
-§CliError(CliError)
Represents an CLI Error in a Leo Error.
-§CompilerError(CompilerError)
Represents an Compiler Error in a Leo Error.
-§PackageError(PackageError)
Represents an Package Error in a Leo Error.
-§ParserError(ParserError)
Represents an Parser Error in a Leo Error.
+§CliError(CliError)
Represents a CLI Error in a Leo Error.
+§CompilerError(CompilerError)
Represents a Compiler Error in a Leo Error.
+§PackageError(PackageError)
Represents a Package Error in a Leo Error.
+§ParserError(ParserError)
Represents a Parser Error in a Leo Error.
§TypeCheckerError(TypeCheckerError)
Represents a Type Checker Error in a Leo Error.
§LoopUnrollerError(LoopUnrollerError)
Represents a Loop Unroller Error in a Leo Error.
§FlattenError(FlattenError)
Represents a Flatten Error in a Leo Error.
§LastErrorCode(i32)
Purely for just exiting with the correct status code and
not re-displaying an error.
-§UtilError(UtilError)
Represents a Utils Error in a Leo Error
+§UtilError(UtilError)
Represents a Utils Error in a Leo Error.
§Anyhow(Error)
Anyhow errors.
Implementations§
source§impl LeoError
sourcepub fn error_code(&self) -> String
Implement error code for each type of Error.
sourcepub fn exit_code(&self) -> i32
Implement exit code for each type of Error.
diff --git a/leo_errors/errors/enum.LeoWarning.html b/leo_errors/errors/enum.LeoWarning.html
index 0faa5539be..c1588d6821 100644
--- a/leo_errors/errors/enum.LeoWarning.html
+++ b/leo_errors/errors/enum.LeoWarning.html
@@ -1,10 +1,10 @@
-LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
+LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
ParserWarning(ParserWarning),
TypeCheckerWarning(TypeCheckerWarning),
-}
Expand description
The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
-Variants§
§ParserWarning(ParserWarning)
Represents an Parser Error in a Leo Error.
-§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Error in a Leo Error.
+}Expand description
The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates.
+Variants§
§ParserWarning(ParserWarning)
Represents an Parser Warning in a Leo Warning.
+§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Warning in a Leo Warning.
Implementations§
source§impl LeoWarning
sourcepub fn error_code(&self) -> String
Implement warning code for each type of Warning.
Trait Implementations§
source§impl Debug for LeoWarning
source§impl Display for LeoWarning
source§impl Error for LeoWarning
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<ParserWarning> for LeoWarning
source§fn from(source: ParserWarning) -> Self
Converts to this type from the input type.source§impl From<TypeCheckerWarning> for LeoWarning
source§fn from(source: TypeCheckerWarning) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for LeoWarning
§impl RefUnwindSafe for LeoWarning
§impl Send for LeoWarning
§impl Sync for LeoWarning
§impl Unpin for LeoWarning
§impl UnwindSafe for LeoWarning
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_errors/errors/index.html b/leo_errors/errors/index.html
index a9aaa3418b..257932bad3 100644
--- a/leo_errors/errors/index.html
+++ b/leo_errors/errors/index.html
@@ -1,4 +1,4 @@
-leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo lang.
+leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo language.
Re-exports§
pub use self::ast::*;
pub use self::cli::*;
pub use self::compiler::*;
pub use self::flattener::*;
pub use self::loop_unroller::*;
pub use self::package::*;
pub use self::parser::*;
pub use self::type_checker::*;
pub use self::utils::*;
Modules§
- Contains the AST error definitions.
- Contains the CLI error definitions.
- Contains the Compiler error definitions.
- Contains the Flattener error definitions.
- Contains the Loop Unroller error definitions.
- Contains the Package error definitions.
- Contains the Parser error definitions.
- Contains the Type Checker error definitions.
- Contains the Utils error definitions.
Enums§
- The LeoError type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
- The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
+This allows a unified error type throughout the Leo crates.The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates. Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
diff --git a/leo_errors/index.html b/leo_errors/index.html
index da14ceb37f..5bbc7ccfbb 100644
--- a/leo_errors/index.html
+++ b/leo_errors/index.html
@@ -46,6 +46,6 @@ §SnarkVM
When SnarkVM implements better error codes and messages, we can bubble them up.
§Utils
The errors related to dependency retrieval in the utils
crate. Its error codes will range from 10_000-10_999 and be prefixed with the characters DEP
.
-
Re-exports§
Modules§
- Contains the common functionalities for defining errors..
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo lang.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
+
Re-exports§
Modules§
- Contains the common functionalities for defining errors.
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo language.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
and error methods generated through a DSL creates and generates errors
with a unique error code.
\ No newline at end of file
diff --git a/leo_package/build/directory/struct.BuildDirectory.html b/leo_package/build/directory/struct.BuildDirectory.html
index fac07569cb..3398708872 100644
--- a/leo_package/build/directory/struct.BuildDirectory.html
+++ b/leo_package/build/directory/struct.BuildDirectory.html
@@ -1,6 +1,6 @@
-BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
source§impl BuildDirectory
sourcepub fn open(path: &Path) -> Result<PathBuf>
Returns the path to the build directory if it exists.
-sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for BuildDirectory
§impl RefUnwindSafe for BuildDirectory
§impl Send for BuildDirectory
§impl Sync for BuildDirectory
§impl Unpin for BuildDirectory
§impl UnwindSafe for BuildDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/fn.parse_file_paths.html b/leo_package/fn.parse_file_paths.html
index 5e8c86b57f..32c80a43ae 100644
--- a/leo_package/fn.parse_file_paths.html
+++ b/leo_package/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package - Rust Function leo_package::parse_file_paths
source · pub(crate) fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/imports/directory/struct.ImportsDirectory.html b/leo_package/imports/directory/struct.ImportsDirectory.html
index f58c759e92..9885ee13dd 100644
--- a/leo_package/imports/directory/struct.ImportsDirectory.html
+++ b/leo_package/imports/directory/struct.ImportsDirectory.html
@@ -1,7 +1,7 @@
-ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name if it does not exist.
-sourcepub fn is_empty(path: &Path) -> Result<bool>
Returns true if the imports directory does not exist or does not contain files.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the imports directory.
+ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
Auto Trait Implementations§
§impl Freeze for ImportsDirectory
§impl RefUnwindSafe for ImportsDirectory
§impl Send for ImportsDirectory
§impl Sync for ImportsDirectory
§impl Unpin for ImportsDirectory
§impl UnwindSafe for ImportsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/inputs/directory/fn.parse_file_paths.html b/leo_package/inputs/directory/fn.parse_file_paths.html
index 1b5a58356c..bbc13fb6c2 100644
--- a/leo_package/inputs/directory/fn.parse_file_paths.html
+++ b/leo_package/inputs/directory/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package::inputs::directory - Rust Function leo_package::inputs::directory::parse_file_paths
source · fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/inputs/directory/struct.InputsDirectory.html b/leo_package/inputs/directory/struct.InputsDirectory.html
index 3be222239e..42e6487029 100644
--- a/leo_package/inputs/directory/struct.InputsDirectory.html
+++ b/leo_package/inputs/directory/struct.InputsDirectory.html
@@ -1,5 +1,5 @@
-InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
source§impl InputsDirectory
sourcepub fn create(path: &Path) -> Result<()>
Creates a directory at the provided path with the default directory name.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the input directory.
+InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for InputsDirectory
§impl RefUnwindSafe for InputsDirectory
§impl Send for InputsDirectory
§impl Sync for InputsDirectory
§impl Unpin for InputsDirectory
§impl UnwindSafe for InputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
index cb29b629d0..fd1493e673 100644
--- a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
+++ b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
@@ -3,8 +3,8 @@
pub snapshot: Snapshot,
}Expand description
Generic Snapshot file wrapper. Each package can have up to 3
different snapshots: initial_ast, canonicalization_ast and type_inferenced_ast;
-Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+
Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn snapshot_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for SnapshotFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for SnapshotFile
§impl RefUnwindSafe for SnapshotFile
§impl Send for SnapshotFile
§impl Sync for SnapshotFile
§impl Unpin for SnapshotFile
§impl UnwindSafe for SnapshotFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/checksum/struct.ChecksumFile.html b/leo_package/outputs/checksum/struct.ChecksumFile.html
index def0ba7fb2..a83b3f87ce 100644
--- a/leo_package/outputs/checksum/struct.ChecksumFile.html
+++ b/leo_package/outputs/checksum/struct.ChecksumFile.html
@@ -1,8 +1,8 @@
ChecksumFile in leo_package::outputs::checksum - Rust Struct leo_package::outputs::checksum::ChecksumFile
source · pub struct ChecksumFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for ChecksumFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ChecksumFile
§impl RefUnwindSafe for ChecksumFile
§impl Send for ChecksumFile
§impl Sync for ChecksumFile
§impl Unpin for ChecksumFile
§impl UnwindSafe for ChecksumFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/circuit/struct.CircuitFile.html b/leo_package/outputs/circuit/struct.CircuitFile.html
index 7a313cccc5..2016ebb713 100644
--- a/leo_package/outputs/circuit/struct.CircuitFile.html
+++ b/leo_package/outputs/circuit/struct.CircuitFile.html
@@ -1,8 +1,8 @@
CircuitFile in leo_package::outputs::circuit - Rust Struct leo_package::outputs::circuit::CircuitFile
source · pub struct CircuitFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for CircuitFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for CircuitFile
§impl RefUnwindSafe for CircuitFile
§impl Send for CircuitFile
§impl Sync for CircuitFile
§impl Unpin for CircuitFile
§impl UnwindSafe for CircuitFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/directory/struct.OutputsDirectory.html b/leo_package/outputs/directory/struct.OutputsDirectory.html
index e6c87e2ceb..eed4aadfb3 100644
--- a/leo_package/outputs/directory/struct.OutputsDirectory.html
+++ b/leo_package/outputs/directory/struct.OutputsDirectory.html
@@ -1,5 +1,5 @@
-OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
source§impl OutputsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for OutputsDirectory
§impl RefUnwindSafe for OutputsDirectory
§impl Send for OutputsDirectory
§impl Sync for OutputsDirectory
§impl Unpin for OutputsDirectory
§impl UnwindSafe for OutputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/package/struct.Package.html b/leo_package/package/struct.Package.html
index 5ddc7ad345..a169387912 100644
--- a/leo_package/package/struct.Package.html
+++ b/leo_package/package/struct.Package.html
@@ -3,8 +3,8 @@
pub version: String,
pub description: Option<String>,
pub license: Option<String>,
- pub network: NetworkName,
-}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
+ pub network: NetworkName,
+}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
Aleo names can only contain ASCII alphanumeric characters and underscores.
sourcepub fn can_initialize(package_name: &str, path: &Path) -> bool
Returns true
if a package is can be initialized at a given path.
fn deserialize<__D>(
__deserializer: __D
) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>where
diff --git a/leo_disassembler/fn.disassemble_from_str.html b/leo_disassembler/fn.disassemble_from_str.html
index 0dc23c5ffd..73dd2bcdf6 100644
--- a/leo_disassembler/fn.disassemble_from_str.html
+++ b/leo_disassembler/fn.disassemble_from_str.html
@@ -1,4 +1,4 @@
disassemble_from_str in leo_disassembler - Rust Function leo_disassembler::disassemble_from_str
source · pub fn disassemble_from_str<N: Network>(
name: &str,
program: &str
-) -> Result<Stub, UtilError>
\ No newline at end of file
+) -> Result<Stub, UtilError>
\ No newline at end of file
diff --git a/leo_errors/common/index.html b/leo_errors/common/index.html
index 9823564797..7349584cbe 100644
--- a/leo_errors/common/index.html
+++ b/leo_errors/common/index.html
@@ -1,2 +1,2 @@
-leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors..
+leo_errors::common - Rust Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors.
Re-exports§
pub use self::backtraced::*;
pub use self::formatted::*;
pub use self::traits::*;
Modules§
- This module contains a backtraced error and its methods.
- This module contains a formatted error and its methods.
- This module contains the macros for making errors easily.
- This module contains traits for making errors easily.
\ No newline at end of file
diff --git a/leo_errors/errors/enum.LeoError.html b/leo_errors/errors/enum.LeoError.html
index 14a74cc5b9..8ec7a32fc3 100644
--- a/leo_errors/errors/enum.LeoError.html
+++ b/leo_errors/errors/enum.LeoError.html
@@ -13,16 +13,16 @@
}Expand description
The LeoError type that contains all sub error types.
This allows a unified error type throughout the Leo crates.
Variants§
§AstError(AstError)
Represents an AST Error in a Leo Error.
-§CliError(CliError)
Represents an CLI Error in a Leo Error.
-§CompilerError(CompilerError)
Represents an Compiler Error in a Leo Error.
-§PackageError(PackageError)
Represents an Package Error in a Leo Error.
-§ParserError(ParserError)
Represents an Parser Error in a Leo Error.
+§CliError(CliError)
Represents a CLI Error in a Leo Error.
+§CompilerError(CompilerError)
Represents a Compiler Error in a Leo Error.
+§PackageError(PackageError)
Represents a Package Error in a Leo Error.
+§ParserError(ParserError)
Represents a Parser Error in a Leo Error.
§TypeCheckerError(TypeCheckerError)
Represents a Type Checker Error in a Leo Error.
§LoopUnrollerError(LoopUnrollerError)
Represents a Loop Unroller Error in a Leo Error.
§FlattenError(FlattenError)
Represents a Flatten Error in a Leo Error.
§LastErrorCode(i32)
Purely for just exiting with the correct status code and
not re-displaying an error.
-§UtilError(UtilError)
Represents a Utils Error in a Leo Error
+§UtilError(UtilError)
Represents a Utils Error in a Leo Error.
§Anyhow(Error)
Anyhow errors.
Implementations§
source§impl LeoError
sourcepub fn error_code(&self) -> String
Implement error code for each type of Error.
sourcepub fn exit_code(&self) -> i32
Implement exit code for each type of Error.
diff --git a/leo_errors/errors/enum.LeoWarning.html b/leo_errors/errors/enum.LeoWarning.html
index 0faa5539be..c1588d6821 100644
--- a/leo_errors/errors/enum.LeoWarning.html
+++ b/leo_errors/errors/enum.LeoWarning.html
@@ -1,10 +1,10 @@
-LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
+LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
ParserWarning(ParserWarning),
TypeCheckerWarning(TypeCheckerWarning),
-}
Expand description
The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
-Variants§
§ParserWarning(ParserWarning)
Represents an Parser Error in a Leo Error.
-§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Error in a Leo Error.
+}Expand description
The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates.
+Variants§
§ParserWarning(ParserWarning)
Represents an Parser Warning in a Leo Warning.
+§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Warning in a Leo Warning.
Implementations§
source§impl LeoWarning
sourcepub fn error_code(&self) -> String
Implement warning code for each type of Warning.
Trait Implementations§
source§impl Debug for LeoWarning
source§impl Display for LeoWarning
source§impl Error for LeoWarning
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<ParserWarning> for LeoWarning
source§fn from(source: ParserWarning) -> Self
Converts to this type from the input type.source§impl From<TypeCheckerWarning> for LeoWarning
source§fn from(source: TypeCheckerWarning) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for LeoWarning
§impl RefUnwindSafe for LeoWarning
§impl Send for LeoWarning
§impl Sync for LeoWarning
§impl Unpin for LeoWarning
§impl UnwindSafe for LeoWarning
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_errors/errors/index.html b/leo_errors/errors/index.html
index a9aaa3418b..257932bad3 100644
--- a/leo_errors/errors/index.html
+++ b/leo_errors/errors/index.html
@@ -1,4 +1,4 @@
-leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo lang.
+leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo language.
Re-exports§
pub use self::ast::*;
pub use self::cli::*;
pub use self::compiler::*;
pub use self::flattener::*;
pub use self::loop_unroller::*;
pub use self::package::*;
pub use self::parser::*;
pub use self::type_checker::*;
pub use self::utils::*;
Modules§
- Contains the AST error definitions.
- Contains the CLI error definitions.
- Contains the Compiler error definitions.
- Contains the Flattener error definitions.
- Contains the Loop Unroller error definitions.
- Contains the Package error definitions.
- Contains the Parser error definitions.
- Contains the Type Checker error definitions.
- Contains the Utils error definitions.
Enums§
- The LeoError type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
- The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
+This allows a unified error type throughout the Leo crates.The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates. Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
diff --git a/leo_errors/index.html b/leo_errors/index.html
index da14ceb37f..5bbc7ccfbb 100644
--- a/leo_errors/index.html
+++ b/leo_errors/index.html
@@ -46,6 +46,6 @@ §SnarkVM
When SnarkVM implements better error codes and messages, we can bubble them up.
§Utils
The errors related to dependency retrieval in the utils
crate. Its error codes will range from 10_000-10_999 and be prefixed with the characters DEP
.
-
Re-exports§
Modules§
- Contains the common functionalities for defining errors..
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo lang.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
+
Re-exports§
Modules§
- Contains the common functionalities for defining errors.
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo language.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
and error methods generated through a DSL creates and generates errors
with a unique error code.
\ No newline at end of file
diff --git a/leo_package/build/directory/struct.BuildDirectory.html b/leo_package/build/directory/struct.BuildDirectory.html
index fac07569cb..3398708872 100644
--- a/leo_package/build/directory/struct.BuildDirectory.html
+++ b/leo_package/build/directory/struct.BuildDirectory.html
@@ -1,6 +1,6 @@
-BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
source§impl BuildDirectory
sourcepub fn open(path: &Path) -> Result<PathBuf>
Returns the path to the build directory if it exists.
-sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for BuildDirectory
§impl RefUnwindSafe for BuildDirectory
§impl Send for BuildDirectory
§impl Sync for BuildDirectory
§impl Unpin for BuildDirectory
§impl UnwindSafe for BuildDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/fn.parse_file_paths.html b/leo_package/fn.parse_file_paths.html
index 5e8c86b57f..32c80a43ae 100644
--- a/leo_package/fn.parse_file_paths.html
+++ b/leo_package/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package - Rust Function leo_package::parse_file_paths
source · pub(crate) fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/imports/directory/struct.ImportsDirectory.html b/leo_package/imports/directory/struct.ImportsDirectory.html
index f58c759e92..9885ee13dd 100644
--- a/leo_package/imports/directory/struct.ImportsDirectory.html
+++ b/leo_package/imports/directory/struct.ImportsDirectory.html
@@ -1,7 +1,7 @@
-ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name if it does not exist.
-sourcepub fn is_empty(path: &Path) -> Result<bool>
Returns true if the imports directory does not exist or does not contain files.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the imports directory.
+ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
Auto Trait Implementations§
§impl Freeze for ImportsDirectory
§impl RefUnwindSafe for ImportsDirectory
§impl Send for ImportsDirectory
§impl Sync for ImportsDirectory
§impl Unpin for ImportsDirectory
§impl UnwindSafe for ImportsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/inputs/directory/fn.parse_file_paths.html b/leo_package/inputs/directory/fn.parse_file_paths.html
index 1b5a58356c..bbc13fb6c2 100644
--- a/leo_package/inputs/directory/fn.parse_file_paths.html
+++ b/leo_package/inputs/directory/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package::inputs::directory - Rust Function leo_package::inputs::directory::parse_file_paths
source · fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/inputs/directory/struct.InputsDirectory.html b/leo_package/inputs/directory/struct.InputsDirectory.html
index 3be222239e..42e6487029 100644
--- a/leo_package/inputs/directory/struct.InputsDirectory.html
+++ b/leo_package/inputs/directory/struct.InputsDirectory.html
@@ -1,5 +1,5 @@
-InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
source§impl InputsDirectory
sourcepub fn create(path: &Path) -> Result<()>
Creates a directory at the provided path with the default directory name.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the input directory.
+InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for InputsDirectory
§impl RefUnwindSafe for InputsDirectory
§impl Send for InputsDirectory
§impl Sync for InputsDirectory
§impl Unpin for InputsDirectory
§impl UnwindSafe for InputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
index cb29b629d0..fd1493e673 100644
--- a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
+++ b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
@@ -3,8 +3,8 @@
pub snapshot: Snapshot,
}Expand description
Generic Snapshot file wrapper. Each package can have up to 3
different snapshots: initial_ast, canonicalization_ast and type_inferenced_ast;
-Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+
Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn snapshot_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for SnapshotFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for SnapshotFile
§impl RefUnwindSafe for SnapshotFile
§impl Send for SnapshotFile
§impl Sync for SnapshotFile
§impl Unpin for SnapshotFile
§impl UnwindSafe for SnapshotFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/checksum/struct.ChecksumFile.html b/leo_package/outputs/checksum/struct.ChecksumFile.html
index def0ba7fb2..a83b3f87ce 100644
--- a/leo_package/outputs/checksum/struct.ChecksumFile.html
+++ b/leo_package/outputs/checksum/struct.ChecksumFile.html
@@ -1,8 +1,8 @@
ChecksumFile in leo_package::outputs::checksum - Rust Struct leo_package::outputs::checksum::ChecksumFile
source · pub struct ChecksumFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for ChecksumFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ChecksumFile
§impl RefUnwindSafe for ChecksumFile
§impl Send for ChecksumFile
§impl Sync for ChecksumFile
§impl Unpin for ChecksumFile
§impl UnwindSafe for ChecksumFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/circuit/struct.CircuitFile.html b/leo_package/outputs/circuit/struct.CircuitFile.html
index 7a313cccc5..2016ebb713 100644
--- a/leo_package/outputs/circuit/struct.CircuitFile.html
+++ b/leo_package/outputs/circuit/struct.CircuitFile.html
@@ -1,8 +1,8 @@
CircuitFile in leo_package::outputs::circuit - Rust Struct leo_package::outputs::circuit::CircuitFile
source · pub struct CircuitFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for CircuitFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for CircuitFile
§impl RefUnwindSafe for CircuitFile
§impl Send for CircuitFile
§impl Sync for CircuitFile
§impl Unpin for CircuitFile
§impl UnwindSafe for CircuitFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/directory/struct.OutputsDirectory.html b/leo_package/outputs/directory/struct.OutputsDirectory.html
index e6c87e2ceb..eed4aadfb3 100644
--- a/leo_package/outputs/directory/struct.OutputsDirectory.html
+++ b/leo_package/outputs/directory/struct.OutputsDirectory.html
@@ -1,5 +1,5 @@
-OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
source§impl OutputsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for OutputsDirectory
§impl RefUnwindSafe for OutputsDirectory
§impl Send for OutputsDirectory
§impl Sync for OutputsDirectory
§impl Unpin for OutputsDirectory
§impl UnwindSafe for OutputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/package/struct.Package.html b/leo_package/package/struct.Package.html
index 5ddc7ad345..a169387912 100644
--- a/leo_package/package/struct.Package.html
+++ b/leo_package/package/struct.Package.html
@@ -3,8 +3,8 @@
pub version: String,
pub description: Option<String>,
pub license: Option<String>,
- pub network: NetworkName,
-}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
+ pub network: NetworkName,
+}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
Aleo names can only contain ASCII alphanumeric characters and underscores.
sourcepub fn can_initialize(package_name: &str, path: &Path) -> bool
Returns true
if a package is can be initialized at a given path.
Function leo_disassembler::disassemble_from_str
source · pub fn disassemble_from_str<N: Network>(
name: &str,
program: &str
-) -> Result<Stub, UtilError>
Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors..
+Module leo_errors::common
source · Expand description
Contains the common functionalities for defining errors.
Re-exports§
pub use self::backtraced::*;
pub use self::formatted::*;
pub use self::traits::*;
Modules§
- This module contains a backtraced error and its methods.
- This module contains a formatted error and its methods.
- This module contains the macros for making errors easily.
- This module contains traits for making errors easily.
Expand description
The LeoError type that contains all sub error types. This allows a unified error type throughout the Leo crates.
Variants§
AstError(AstError)
Represents an AST Error in a Leo Error.
-CliError(CliError)
Represents an CLI Error in a Leo Error.
-CompilerError(CompilerError)
Represents an Compiler Error in a Leo Error.
-PackageError(PackageError)
Represents an Package Error in a Leo Error.
-ParserError(ParserError)
Represents an Parser Error in a Leo Error.
+CliError(CliError)
Represents a CLI Error in a Leo Error.
+CompilerError(CompilerError)
Represents a Compiler Error in a Leo Error.
+PackageError(PackageError)
Represents a Package Error in a Leo Error.
+ParserError(ParserError)
Represents a Parser Error in a Leo Error.
TypeCheckerError(TypeCheckerError)
Represents a Type Checker Error in a Leo Error.
LoopUnrollerError(LoopUnrollerError)
Represents a Loop Unroller Error in a Leo Error.
FlattenError(FlattenError)
Represents a Flatten Error in a Leo Error.
LastErrorCode(i32)
Purely for just exiting with the correct status code and not re-displaying an error.
-UtilError(UtilError)
Represents a Utils Error in a Leo Error
+UtilError(UtilError)
Represents a Utils Error in a Leo Error.
Anyhow(Error)
Anyhow errors.
Implementations§
source§impl LeoError
impl LeoError
sourcepub fn error_code(&self) -> String
pub fn error_code(&self) -> String
Implement error code for each type of Error.
sourcepub fn exit_code(&self) -> i32
pub fn exit_code(&self) -> i32
Implement exit code for each type of Error.
diff --git a/leo_errors/errors/enum.LeoWarning.html b/leo_errors/errors/enum.LeoWarning.html index 0faa5539be..c1588d6821 100644 --- a/leo_errors/errors/enum.LeoWarning.html +++ b/leo_errors/errors/enum.LeoWarning.html @@ -1,10 +1,10 @@ -Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
+LeoWarning in leo_errors::errors - Rust Enum leo_errors::errors::LeoWarning
source · pub enum LeoWarning {
ParserWarning(ParserWarning),
TypeCheckerWarning(TypeCheckerWarning),
-}
Expand description
The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
-Variants§
§ParserWarning(ParserWarning)
Represents an Parser Error in a Leo Error.
-§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Error in a Leo Error.
+}Expand description
The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates.
+Variants§
§ParserWarning(ParserWarning)
Represents an Parser Warning in a Leo Warning.
+§TypeCheckerWarning(TypeCheckerWarning)
Represents a Type Checker Warning in a Leo Warning.
Implementations§
source§impl LeoWarning
sourcepub fn error_code(&self) -> String
Implement warning code for each type of Warning.
Trait Implementations§
source§impl Debug for LeoWarning
source§impl Display for LeoWarning
source§impl Error for LeoWarning
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<ParserWarning> for LeoWarning
source§fn from(source: ParserWarning) -> Self
Converts to this type from the input type.source§impl From<TypeCheckerWarning> for LeoWarning
source§fn from(source: TypeCheckerWarning) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for LeoWarning
§impl RefUnwindSafe for LeoWarning
§impl Send for LeoWarning
§impl Sync for LeoWarning
§impl Unpin for LeoWarning
§impl UnwindSafe for LeoWarning
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/leo_errors/errors/index.html b/leo_errors/errors/index.html
index a9aaa3418b..257932bad3 100644
--- a/leo_errors/errors/index.html
+++ b/leo_errors/errors/index.html
@@ -1,4 +1,4 @@
-leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo lang.
+leo_errors::errors - Rust Module leo_errors::errors
source · Expand description
Contains the errors and warnings for the Leo language.
Re-exports§
pub use self::ast::*;
pub use self::cli::*;
pub use self::compiler::*;
pub use self::flattener::*;
pub use self::loop_unroller::*;
pub use self::package::*;
pub use self::parser::*;
pub use self::type_checker::*;
pub use self::utils::*;
Modules§
- Contains the AST error definitions.
- Contains the CLI error definitions.
- Contains the Compiler error definitions.
- Contains the Flattener error definitions.
- Contains the Loop Unroller error definitions.
- Contains the Package error definitions.
- Contains the Parser error definitions.
- Contains the Type Checker error definitions.
- Contains the Utils error definitions.
Enums§
- The LeoError type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
- The LeoWarning type that contains all sub error types.
-This allows a unified error type throughout the Leo crates.
Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
+This allows a unified error type throughout the Leo crates.The LeoWarning type that contains all sub warning types.
+This allows a unified warning type throughout the Leo crates. Type Aliases§
- A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file
diff --git a/leo_errors/index.html b/leo_errors/index.html
index da14ceb37f..5bbc7ccfbb 100644
--- a/leo_errors/index.html
+++ b/leo_errors/index.html
@@ -46,6 +46,6 @@ §SnarkVM
When SnarkVM implements better error codes and messages, we can bubble them up.
§Utils
The errors related to dependency retrieval in the utils
crate. Its error codes will range from 10_000-10_999 and be prefixed with the characters DEP
.
-
Re-exports§
Modules§
- Contains the common functionalities for defining errors..
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo lang.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
+
Re-exports§
Modules§
- Contains the common functionalities for defining errors.
- Contains traits and types for channels through which errors go.
- Contains the errors and warnings for the Leo language.
Macros§
- A macro that given an enum, exit code mask, error code string prefix,
and error methods generated through a DSL creates and generates errors
with a unique error code.
\ No newline at end of file
diff --git a/leo_package/build/directory/struct.BuildDirectory.html b/leo_package/build/directory/struct.BuildDirectory.html
index fac07569cb..3398708872 100644
--- a/leo_package/build/directory/struct.BuildDirectory.html
+++ b/leo_package/build/directory/struct.BuildDirectory.html
@@ -1,6 +1,6 @@
-BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
source§impl BuildDirectory
sourcepub fn open(path: &Path) -> Result<PathBuf>
Returns the path to the build directory if it exists.
-sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+BuildDirectory in leo_package::build::directory - Rust Struct leo_package::build::directory::BuildDirectory
source · pub struct BuildDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for BuildDirectory
§impl RefUnwindSafe for BuildDirectory
§impl Send for BuildDirectory
§impl Sync for BuildDirectory
§impl Unpin for BuildDirectory
§impl UnwindSafe for BuildDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/fn.parse_file_paths.html b/leo_package/fn.parse_file_paths.html
index 5e8c86b57f..32c80a43ae 100644
--- a/leo_package/fn.parse_file_paths.html
+++ b/leo_package/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package - Rust Function leo_package::parse_file_paths
source · pub(crate) fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/imports/directory/struct.ImportsDirectory.html b/leo_package/imports/directory/struct.ImportsDirectory.html
index f58c759e92..9885ee13dd 100644
--- a/leo_package/imports/directory/struct.ImportsDirectory.html
+++ b/leo_package/imports/directory/struct.ImportsDirectory.html
@@ -1,7 +1,7 @@
-ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name if it does not exist.
-sourcepub fn is_empty(path: &Path) -> Result<bool>
Returns true if the imports directory does not exist or does not contain files.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the imports directory.
+ImportsDirectory in leo_package::imports::directory - Rust Struct leo_package::imports::directory::ImportsDirectory
source · pub struct ImportsDirectory;
Implementations§
source§impl ImportsDirectory
Auto Trait Implementations§
§impl Freeze for ImportsDirectory
§impl RefUnwindSafe for ImportsDirectory
§impl Send for ImportsDirectory
§impl Sync for ImportsDirectory
§impl Unpin for ImportsDirectory
§impl UnwindSafe for ImportsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/inputs/directory/fn.parse_file_paths.html b/leo_package/inputs/directory/fn.parse_file_paths.html
index 1b5a58356c..bbc13fb6c2 100644
--- a/leo_package/inputs/directory/fn.parse_file_paths.html
+++ b/leo_package/inputs/directory/fn.parse_file_paths.html
@@ -1,4 +1,4 @@
parse_file_paths in leo_package::inputs::directory - Rust Function leo_package::inputs::directory::parse_file_paths
source · fn parse_file_paths(
directory: ReadDir,
file_paths: &mut Vec<PathBuf>
-) -> Result<()>
\ No newline at end of file
+) -> Result<()>
\ No newline at end of file
diff --git a/leo_package/inputs/directory/struct.InputsDirectory.html b/leo_package/inputs/directory/struct.InputsDirectory.html
index 3be222239e..42e6487029 100644
--- a/leo_package/inputs/directory/struct.InputsDirectory.html
+++ b/leo_package/inputs/directory/struct.InputsDirectory.html
@@ -1,5 +1,5 @@
-InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
source§impl InputsDirectory
sourcepub fn create(path: &Path) -> Result<()>
Creates a directory at the provided path with the default directory name.
-sourcepub fn files(path: &Path) -> Result<Vec<PathBuf>>
Returns a list of files in the input directory.
+InputsDirectory in leo_package::inputs::directory - Rust Struct leo_package::inputs::directory::InputsDirectory
source · pub struct InputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for InputsDirectory
§impl RefUnwindSafe for InputsDirectory
§impl Send for InputsDirectory
§impl Sync for InputsDirectory
§impl Unpin for InputsDirectory
§impl UnwindSafe for InputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
index cb29b629d0..fd1493e673 100644
--- a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
+++ b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html
@@ -3,8 +3,8 @@
pub snapshot: Snapshot,
}Expand description
Generic Snapshot file wrapper. Each package can have up to 3
different snapshots: initial_ast, canonicalization_ast and type_inferenced_ast;
-Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+
Fields§
§package_name: String
§snapshot: Snapshot
Implementations§
source§impl SnapshotFile
sourcepub fn new(package_name: &str, snapshot: Snapshot) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn snapshot_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for SnapshotFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for SnapshotFile
§impl RefUnwindSafe for SnapshotFile
§impl Send for SnapshotFile
§impl Sync for SnapshotFile
§impl Unpin for SnapshotFile
§impl UnwindSafe for SnapshotFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/checksum/struct.ChecksumFile.html b/leo_package/outputs/checksum/struct.ChecksumFile.html
index def0ba7fb2..a83b3f87ce 100644
--- a/leo_package/outputs/checksum/struct.ChecksumFile.html
+++ b/leo_package/outputs/checksum/struct.ChecksumFile.html
@@ -1,8 +1,8 @@
ChecksumFile in leo_package::outputs::checksum - Rust Struct leo_package::outputs::checksum::ChecksumFile
source · pub struct ChecksumFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl ChecksumFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for ChecksumFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ChecksumFile
§impl RefUnwindSafe for ChecksumFile
§impl Send for ChecksumFile
§impl Sync for ChecksumFile
§impl Unpin for ChecksumFile
§impl UnwindSafe for ChecksumFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/circuit/struct.CircuitFile.html b/leo_package/outputs/circuit/struct.CircuitFile.html
index 7a313cccc5..2016ebb713 100644
--- a/leo_package/outputs/circuit/struct.CircuitFile.html
+++ b/leo_package/outputs/circuit/struct.CircuitFile.html
@@ -1,8 +1,8 @@
CircuitFile in leo_package::outputs::circuit - Rust Struct leo_package::outputs::circuit::CircuitFile
source · pub struct CircuitFile {
pub package_name: String,
-}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
-sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
-sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
+}
Fields§
§package_name: String
Implementations§
source§impl CircuitFile
sourcepub fn new(package_name: &str) -> Self
sourcepub fn exists_at(&self, path: &Path) -> bool
sourcepub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
+sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
+sourcepub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
sourcefn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
source§impl<'de> Deserialize<'de> for CircuitFile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for CircuitFile
§impl RefUnwindSafe for CircuitFile
§impl Send for CircuitFile
§impl Sync for CircuitFile
§impl Unpin for CircuitFile
§impl UnwindSafe for CircuitFile
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/leo_package/outputs/directory/struct.OutputsDirectory.html b/leo_package/outputs/directory/struct.OutputsDirectory.html
index e6c87e2ceb..eed4aadfb3 100644
--- a/leo_package/outputs/directory/struct.OutputsDirectory.html
+++ b/leo_package/outputs/directory/struct.OutputsDirectory.html
@@ -1,5 +1,5 @@
-OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
source§impl OutputsDirectory
sourcepub fn create(path: &Path) -> Result<PathBuf>
Creates a directory at the provided path with the default directory name.
-sourcepub fn remove(path: &Path) -> Result<String>
Removes the directory at the provided path.
+OutputsDirectory in leo_package::outputs::directory - Rust Struct leo_package::outputs::directory::OutputsDirectory
source · pub struct OutputsDirectory;
Implementations§
Auto Trait Implementations§
§impl Freeze for OutputsDirectory
§impl RefUnwindSafe for OutputsDirectory
§impl Send for OutputsDirectory
§impl Sync for OutputsDirectory
§impl Unpin for OutputsDirectory
§impl UnwindSafe for OutputsDirectory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/leo_package/package/struct.Package.html b/leo_package/package/struct.Package.html
index 5ddc7ad345..a169387912 100644
--- a/leo_package/package/struct.Package.html
+++ b/leo_package/package/struct.Package.html
@@ -3,8 +3,8 @@
pub version: String,
pub description: Option<String>,
pub license: Option<String>,
- pub network: NetworkName,
-}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
+ pub network: NetworkName,
+}Fields§
§name: String
§version: String
§description: Option<String>
§license: Option<String>
§network: NetworkName
Implementations§
source§impl Package
sourcepub fn new(package_name: &str, network: NetworkName) -> Result<Self>
sourcepub fn is_aleo_name_valid(name: &str) -> bool
Returns true
if it is a valid Aleo name.
Aleo names can only contain ASCII alphanumeric characters and underscores.
sourcepub fn can_initialize(package_name: &str, path: &Path) -> bool
Returns true
if a package is can be initialized at a given path.