Parser

Trait Parser 

Source
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§

Source

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

Parses a string literal into an object.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

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

Source§

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

Parses a UTF-8 string into an access.

Source§

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

Source§

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

Parses a string into a literal.

Source§

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

Source§

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

Parses a string into a signature circuit.

Source§

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

Source§

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

Parses a UTF-8 string into an identifier.

Source§

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

Source§

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

Parses a string into an address circuit.

Source§

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

Source§

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

Parses a string into a boolean circuit.

Source§

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

Source§

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

Parses a string into a field circuit.

Source§

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

Source§

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

Parses a string into a group circuit.

Source§

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

Source§

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

Parses a string into a scalar circuit.

Source§

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

Source§

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

Parses a string into a string circuit.

Source§

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

Source§

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

Parses a string into an integer circuit.

Source§

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

Source§

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

Parses the string into the command.

Source§

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

Source§

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

Parses a string into an operator.

Source§

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

Source§

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

Parses a string into a operand.

Source§

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

Source§

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

Parses a string into an operator.

Source§

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

Source§

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

Source§

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

Source§

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.

Source§

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

Source§

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

Parses a string into an operation.

Source§

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

Source§

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

Parses a string into an operation.

Source§

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

Source§

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

Parses a string into an operation.

Source§

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

Source§

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

Parses a string into an operation.

Source§

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

Source§

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

Parses a string into a command.

Source§

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

Source§

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

Parses a string into an operation.

Source§

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

Source§

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

Parses a string into an operation.

Source§

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

Source§

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

Parses a string into an operation.

Source§

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

Source§

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

Parses a string into an operation.

Source§

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

Source§

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

Parses a string into an operation.

Source§

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

Source§

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

Parses a string into an operation.

Source§

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

Source§

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

Parses a string into finalize.

Source§

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

Source§

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

Parses a string into a closure.

Source§

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

Source§

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

Parses a string into a function.

Source§

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

Source§

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

Parses a string into a program.

Source§

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>,

Source§

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

Parses a string into an operation.

Source§

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

Source§

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

Parses a string into an command.

Source§

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

Source§

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

Parses a string into an operation.

Source§

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

Source§

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

Parses a string into an operation.

Source§

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

Source§

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

Parses a string into an operation.

Source§

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

Source§

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

Parses a string into an operation.

Source§

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

Source§

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

Parses a string into an operation.

Implementors§

Source§

impl Parser for LiteralType

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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