pub trait Parser: Display + FromStr {
    // Required method
    fn parse(string: &str) -> Result<(&str, Self), Err<VerboseError<&str>>>
       where Self: Sized;
}
Expand description

Operations to parse a string literal into an object.

Required Methods§

fn parse(string: &str) -> Result<(&str, Self), Err<VerboseError<&str>>>
where Self: Sized,

Parses a string literal into an object.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl<A> Parser for Access<A>
where A: Aleo,

§

fn parse(string: &str) -> Result<(&str, Access<A>), Err<VerboseError<&str>>>

Parses a UTF-8 string into an access.

§

impl<A> Parser for Identifier<A>
where A: Aleo,

§

fn parse(string: &str) -> Result<(&str, Identifier<A>), Err<VerboseError<&str>>>

Parses a UTF-8 string into an identifier.

§

impl<A> Parser for Literal<A>
where A: Aleo,

§

fn parse(string: &str) -> Result<(&str, Literal<A>), Err<VerboseError<&str>>>

Parses a string into a literal.

§

impl<A> Parser for Signature<A>
where A: Aleo,

§

fn parse(string: &str) -> Result<(&str, Signature<A>), Err<VerboseError<&str>>>

Parses a string into a signature circuit.

§

impl<E> Parser for Address<E>
where E: Environment,

§

fn parse(string: &str) -> Result<(&str, Address<E>), Err<VerboseError<&str>>>

Parses a string into an address circuit.

§

impl<E> Parser for Boolean<E>
where E: Environment,

§

fn parse(string: &str) -> Result<(&str, Boolean<E>), Err<VerboseError<&str>>>

Parses a string into a boolean circuit.

§

impl<E> Parser for Field<E>
where E: Environment,

§

fn parse(string: &str) -> Result<(&str, Field<E>), Err<VerboseError<&str>>>

Parses a string into a field circuit.

§

impl<E> Parser for Group<E>
where E: Environment,

§

fn parse(string: &str) -> Result<(&str, Group<E>), Err<VerboseError<&str>>>

Parses a string into a group circuit.

§

impl<E> Parser for Scalar<E>
where E: Environment,

§

fn parse(string: &str) -> Result<(&str, Scalar<E>), Err<VerboseError<&str>>>

Parses a string into a scalar circuit.

§

impl<E> Parser for StringType<E>
where E: Environment,

§

fn parse(string: &str) -> Result<(&str, StringType<E>), Err<VerboseError<&str>>>

Parses a string into a string circuit.

§

impl<E, I> Parser for Integer<E, I>
where E: Environment, I: IntegerType,

§

fn parse(string: &str) -> Result<(&str, Integer<E, I>), Err<VerboseError<&str>>>

Parses a string into an integer circuit.

§

impl<N> Parser for Async<N>
where N: Network,

§

fn parse(string: &str) -> Result<(&str, Async<N>), Err<VerboseError<&str>>>

Parses a string into an operation.

§

impl<N> Parser for Await<N>
where N: Network,

§

fn parse(string: &str) -> Result<(&str, Await<N>), Err<VerboseError<&str>>>

Parses a string into an operation.

§

impl<N> Parser for Call<N>
where N: Network,

§

fn parse(string: &str) -> Result<(&str, Call<N>), Err<VerboseError<&str>>>

Parses a string into an operation.

§

impl<N> Parser for CallOperator<N>
where N: Network,

§

fn parse( string: &str ) -> Result<(&str, CallOperator<N>), Err<VerboseError<&str>>>

Parses a string into an operator.

§

impl<N> Parser for CastType<N>
where N: Network,

§

fn parse(string: &str) -> Result<(&str, CastType<N>), Err<VerboseError<&str>>>

§

impl<N> Parser for Command<N>
where N: Network,

§

fn parse(string: &str) -> Result<(&str, Command<N>), Err<VerboseError<&str>>>

Parses the string into the command.

§

impl<N> Parser for Contains<N>
where N: Network,

§

fn parse(string: &str) -> Result<(&str, Contains<N>), Err<VerboseError<&str>>>

Parses a string into an operation.

§

impl<N> Parser for Get<N>
where N: Network,

§

fn parse(string: &str) -> Result<(&str, Get<N>), Err<VerboseError<&str>>>

Parses a string into an operation.

§

impl<N> Parser for GetOrUse<N>
where N: Network,

§

fn parse(string: &str) -> Result<(&str, GetOrUse<N>), Err<VerboseError<&str>>>

Parses a string into an operation.

§

impl<N> Parser for Import<N>
where N: Network,

§

fn parse(string: &str) -> Result<(&str, Import<N>), Err<VerboseError<&str>>>

Parses a string into an import statement of the form import {name}.{network};. If no network-level domain is specified, the default network is used.

§

impl<N> Parser for MappingLocator<N>
where N: Network,

§

fn parse( string: &str ) -> Result<(&str, MappingLocator<N>), Err<VerboseError<&str>>>

Parses a string into an operator.

§

impl<N> Parser for Operand<N>
where N: Network,

§

fn parse(string: &str) -> Result<(&str, Operand<N>), Err<VerboseError<&str>>>

Parses a string into a operand.

§

impl<N> Parser for Position<N>
where N: Network,

§

fn parse(string: &str) -> Result<(&str, Position<N>), Err<VerboseError<&str>>>

Parses a string into a command.

§

impl<N> Parser for RandChaCha<N>
where N: Network,

§

fn parse(string: &str) -> Result<(&str, RandChaCha<N>), Err<VerboseError<&str>>>

Parses a string into an operation.

§

impl<N> Parser for Remove<N>
where N: Network,

§

fn parse(string: &str) -> Result<(&str, Remove<N>), Err<VerboseError<&str>>>

Parses a string into an operation.

§

impl<N> Parser for Set<N>
where N: Network,

§

fn parse(string: &str) -> Result<(&str, Set<N>), Err<VerboseError<&str>>>

Parses a string into an operation.

§

impl<N> Parser for SignVerify<N>
where N: Network,

§

fn parse(string: &str) -> Result<(&str, SignVerify<N>), Err<VerboseError<&str>>>

Parses a string into an operation.

§

impl<N, Command> Parser for FinalizeCore<N, Command>
where N: Network, Command: CommandTrait<N>,

§

fn parse( string: &str ) -> Result<(&str, FinalizeCore<N, Command>), Err<VerboseError<&str>>>

Parses a string into finalize.

§

impl<N, Instruction> Parser for ClosureCore<N, Instruction>
where N: Network, Instruction: InstructionTrait<N>,

§

fn parse( string: &str ) -> Result<(&str, ClosureCore<N, Instruction>), Err<VerboseError<&str>>>

Parses a string into a closure.

§

impl<N, Instruction, Command> Parser for FunctionCore<N, Instruction, Command>
where N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>,

§

fn parse( string: &str ) -> Result<(&str, FunctionCore<N, Instruction, Command>), Err<VerboseError<&str>>>

Parses a string into a function.

§

impl<N, Instruction, Command> Parser for ProgramCore<N, Instruction, Command>
where N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>,

§

fn parse( string: &str ) -> Result<(&str, ProgramCore<N, Instruction, Command>), Err<VerboseError<&str>>>

Parses a string into a program.

§

impl<N, O, const NUM_OPERANDS: usize> Parser for Literals<N, O, NUM_OPERANDS>
where N: Network, O: Operation<N, Literal<N>, LiteralType, NUM_OPERANDS>,

§

fn parse( string: &str ) -> Result<(&str, Literals<N, O, NUM_OPERANDS>), Err<VerboseError<&str>>>

Parses a string into an operation.

§

impl<N, const VARIANT: u8> Parser for AssertInstruction<N, VARIANT>
where N: Network,

§

fn parse( string: &str ) -> Result<(&str, AssertInstruction<N, VARIANT>), Err<VerboseError<&str>>>

Parses a string into an operation.

§

impl<N, const VARIANT: u8> Parser for Branch<N, VARIANT>
where N: Network,

§

fn parse( string: &str ) -> Result<(&str, Branch<N, VARIANT>), Err<VerboseError<&str>>>

Parses a string into an command.

§

impl<N, const VARIANT: u8> Parser for CastOperation<N, VARIANT>
where N: Network,

§

fn parse( string: &str ) -> Result<(&str, CastOperation<N, VARIANT>), Err<VerboseError<&str>>>

Parses a string into an operation.

§

impl<N, const VARIANT: u8> Parser for CommitInstruction<N, VARIANT>
where N: Network,

§

fn parse( string: &str ) -> Result<(&str, CommitInstruction<N, VARIANT>), Err<VerboseError<&str>>>

Parses a string into an operation.

§

impl<N, const VARIANT: u8> Parser for HashInstruction<N, VARIANT>
where N: Network,

§

fn parse( string: &str ) -> Result<(&str, HashInstruction<N, VARIANT>), Err<VerboseError<&str>>>

Parses a string into an operation.

§

impl<N, const VARIANT: u8> Parser for IsInstruction<N, VARIANT>
where N: Network,

§

fn parse( string: &str ) -> Result<(&str, IsInstruction<N, VARIANT>), Err<VerboseError<&str>>>

Parses a string into an operation.

Implementors§

§

impl Parser for LiteralType

§

impl<E> Parser for snarkvm_debug::prelude::address::Address<E>
where E: Environment,

§

impl<E> Parser for snarkvm_debug::prelude::group::Group<E>
where E: Environment,

§

impl<E> Parser for snarkvm_debug::prelude::scalar::Scalar<E>
where E: Environment,

§

impl<E> Parser for snarkvm_debug::prelude::StringType<E>
where E: Environment,

§

impl<E> Parser for snarkvm_debug::prelude::string::Boolean<E>
where E: Environment,

§

impl<E> Parser for snarkvm_debug::prelude::string::Field<E>
where E: Environment,

§

impl<E, I> Parser for snarkvm_debug::prelude::string::Integer<E, I>
where E: Environment, I: IntegerType,

§

impl<N> Parser for snarkvm_debug::prelude::Access<N>
where N: Network,

§

impl<N> Parser for Entry<N, Plaintext<N>>
where N: Network,

§

impl<N> Parser for EntryType<N>
where N: Network,

§

impl<N> Parser for FinalizeType<N>
where N: Network,

§

impl<N> Parser for Instruction<N>
where N: Network,

§

impl<N> Parser for snarkvm_debug::prelude::Literal<N>
where N: Network,

§

impl<N> Parser for Plaintext<N>
where N: Network,

§

impl<N> Parser for PlaintextType<N>
where N: Network,

§

impl<N> Parser for Register<N>
where N: Network,

§

impl<N> Parser for RegisterType<N>
where N: Network,

§

impl<N> Parser for Value<N>
where N: Network,

§

impl<N> Parser for ValueType<N>
where N: Network,

§

impl<N> Parser for ArrayType<N>
where N: Network,

§

impl<N> Parser for Certificate<N>
where N: Network,

§

impl<N> Parser for Ciphertext<N>
where N: Network,

§

impl<N> Parser for Future<N>
where N: Network,

§

impl<N> Parser for snarkvm_debug::prelude::Identifier<N>
where N: Network,

§

impl<N> Parser for Locator<N>
where N: Network,

§

impl<N> Parser for Mapping<N>
where N: Network,

§

impl<N> Parser for ProgramID<N>
where N: Network,

§

impl<N> Parser for Proof<N>
where N: Network,

§

impl<N> Parser for ProvingKey<N>
where N: Network,

§

impl<N> Parser for Record<N, Plaintext<N>>
where N: Network,

§

impl<N> Parser for Record<N, Ciphertext<N>>
where N: Network,

§

impl<N> Parser for RecordType<N>
where N: Network,

§

impl<N> Parser for snarkvm_debug::prelude::Signature<N>
where N: Network,

§

impl<N> Parser for StatePath<N>
where N: Network,

§

impl<N> Parser for StructType<N>
where N: Network,

§

impl<N> Parser for VerifyingKey<N>
where N: Network,