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.

Implementations on Foreign Types§

§

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.

§

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.

§

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, 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 a integer 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 type.

§

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 Signature<N>where N: Network,

§

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

Parses a string into an signature.

§

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

§

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

Parses the string into a value type.

§

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

§

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

Parses a struct as:

  struct message:
      owner as address;
      amount as u64;
§

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

§

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

Parses a record type as:

  record message:
      owner as address.private;
      user_defined as u64.public;
§

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

§

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

Parses a string into a register. The register is of the form r{locator} or r{locator}.{identifier}.

§

impl Parser for LiteralType

§

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

Parses a string into a literal type.

§

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

§

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

Parses a string into a plaintext value.

§

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

§

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

Parses a string into a plaintext type.

§

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

§

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

Parses a string into a literal.

§

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

§

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

Parses a string into an ciphertext.

§

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

§

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

Parses a string into a register type.

§

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

§

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

Parses a string into a program ID of the form {name}.{network}.

§

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

§

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

Parses a string into the state path.

§

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

§

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

Parses a string into a value.

§

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

§

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

Parses a string into an identifier.

Requirements

The identifier must be alphanumeric (or underscore). The identifier must not start with a number. The identifier must not be a keyword.

§

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

§

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

Parses a string into the entry type.

§

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

§

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

Parses a string into a locator of the form {program_id}/{resource}.

§

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

§

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

Parses a string into an ciphertext.

§

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

§

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

Parses a string as a record: { owner: address, identifier_0: entry_0, ..., identifier_n: entry_n, _nonce: field }.

§

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

§

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

Parses a string into the entry.

Implementors§

source§

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

source§

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

§

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

§

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

§

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

§

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

§

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

§

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