Module snarkvm_circuit_environment::prelude
source · Re-exports
pub use crate::count;
pub use crate::count;
pub use crate::witness;
pub use crate::witness;
pub use crate::CircuitType;
pub use crate::Count;
pub use crate::Environment;
pub use crate::LinearCombination;
pub use crate::OutputMode;
pub use crate::Variable;
pub use console::prelude::One as _;
pub use console::prelude::Zero as _;
pub use console::traits::Double as _;
pub use console::traits::FromBits as _;
pub use console::traits::Inverse as _;
pub use console::traits::Square as _;
pub use console::traits::SquareRoot as _;
pub use console::traits::ToBits as _;
pub use snarkvm_fields::Field as _;
pub use snarkvm_fields::Zero as _;
pub use snarkvm_utilities::ToBits as _;
pub use snarkvm_curves::AffineCurve as _;
pub use crate::traits::*;
Modules
Utilities for formatting and printing strings.
From https://github.com/Geal/nom/blob/main/examples/string.rs
This example shows an example of how to parse an escaped string. The
rules for the string are similar to JSON and rust. A string is:
Macros
Derive macro generating an impl of the trait
Debug
.Return early with an error.
The
witness!
macro is a closure that takes in a list of circuits,
eject the value of each circuit, and uses it in the subsequent code block.The
witness_mode!
macro returns the expected mode given a list of circuits.Structs
The
Error
type, a wrapper around a dynamic error type.Configuration for formatting.
A hash table where the iteration order of the key-value pairs is independent
of the hash values of the keys.
A cell which can be written to only once. It is not thread safe.
Enums
Traits
The addition operator
+
.The addition assignment operator
+=
.The bitwise AND operator
&
.The bitwise AND assignment operator
&=
.The bitwise OR operator
|
.The bitwise OR assignment operator
|=
.The bitwise XOR operator
^
.The bitwise XOR assignment operator
^=
.?
formatting.Used for immutable dereferencing operations, like
*v
.Format trait for an empty format,
{}
.The division operator
/
.The division assignment operator
/=
.Parse a value from a string
Properties common to all integer types.
Trait bound for integer values. Common to both signed and unsigned integers.
Unary operator for retrieving the multiplicative inverse, or reciprocal, of a value.
Trait for integers that can be used as an unsigned magnitude.
Magnitude
s are either used to represent an integer exponent
or the right operand in integer shift operations.The multiplication operator
*
.The multiplication assignment operator
*=
.The unary negation operator
-
.The unary logical negation operator
!
.Defines a multiplicative identity element for
Self
.Operations to parse a string literal into an object.
Binary operator for raising a value to a power.
The interface for a prime field.
The remainder operator
%
.The remainder assignment operator
%=
.The left shift operator
<<
. Note that because this trait is implemented
for all integer types with multiple right-hand-side types, Rust’s type
checker has special handling for _ << _
, setting the result type for
integer operations to the type of the left-hand-side operand. This means
that though a << b
and a.shl(b)
are one and the same from an evaluation
standpoint, they are different when it comes to type inference.The left shift assignment operator
<<=
.The right shift operator
>>
. Note that because this trait is implemented
for all integer types with multiple right-hand-side types, Rust’s type
checker has special handling for _ >> _
, setting the result type for
integer operations to the type of the left-hand-side operand. This means
that though a >> b
and a.shr(b)
are one and the same from an evaluation
standpoint, they are different when it comes to type inference.The right shift assignment operator
>>=
.The subtraction operator
-
.The subtraction assignment operator
-=
.A trait for values which cannot be negative
Functions
Recognizes one or more lowercase and uppercase ASCII alphabetic characters: a-z, A-Z
Recognizes one or more ASCII numerical and alphabetic characters: 0-9, a-z, A-Z
Tests a list of parsers one by one until one succeeds.
Recognizes one character.
Returns true if the given iterator has duplicate elements.
Repeats the embedded parser until it fails
and returns the results in a
Vec
.Runs the embedded parser until it fails and
returns the results in a
Vec
. Fails if
the embedded parser does not produce at least
one result.Maps a function on the result of a parser.
Applies a function returning a
Result
over the result of a parser.Recognizes one of the provided characters.
Optional parser: Will return
None
if not successful.Gets an object from the first parser,
then gets another object from the second parser.
If the child parser was successful, return the consumed input as produced value.
Recognizes a pattern
Gets an object from the first parser,
then matches an object from the second parser and discards it.
Type Definitions
The
nom
-compatible parser return type.Result<T, Error>