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§
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 Parser for LiteralType
impl Parser for LiteralType
Source§fn parse(string: &str) -> Result<(&str, LiteralType), Err<VerboseError<&str>>>
fn parse(string: &str) -> Result<(&str, LiteralType), Err<VerboseError<&str>>>
Parses a string into a literal type.
Source§impl<E> Parser for Address<E>where
E: Environment,
impl<E> Parser for Address<E>where
E: Environment,
Source§impl<E> Parser for Boolean<E>where
E: Environment,
impl<E> Parser for Boolean<E>where
E: Environment,
Source§impl<E> Parser for Field<E>where
E: Environment,
impl<E> Parser for Field<E>where
E: Environment,
Source§impl<E> Parser for Group<E>where
E: Environment,
impl<E> Parser for Group<E>where
E: Environment,
Source§impl<E> Parser for Scalar<E>where
E: Environment,
impl<E> Parser for Scalar<E>where
E: Environment,
Source§impl<E> Parser for StringType<E>where
E: Environment,
impl<E> Parser for StringType<E>where
E: Environment,
Source§fn parse(string: &str) -> Result<(&str, StringType<E>), Err<VerboseError<&str>>>
fn parse(string: &str) -> Result<(&str, StringType<E>), Err<VerboseError<&str>>>
Parses a string into a string type.
Source§impl<E, I> Parser for Integer<E, I>where
E: Environment,
I: IntegerType,
impl<E, I> Parser for Integer<E, I>where
E: Environment,
I: IntegerType,
Source§impl<N> Parser for FinalizeType<N>where
N: Network,
impl<N> Parser for FinalizeType<N>where
N: Network,
Source§fn parse(
string: &str,
) -> Result<(&str, FinalizeType<N>), Err<VerboseError<&str>>>
fn parse( string: &str, ) -> Result<(&str, FinalizeType<N>), Err<VerboseError<&str>>>
Parses a string into a finalize type.
Source§impl<N> Parser for PlaintextType<N>where
N: Network,
impl<N> Parser for PlaintextType<N>where
N: Network,
Source§fn parse(
string: &str,
) -> Result<(&str, PlaintextType<N>), Err<VerboseError<&str>>>
fn parse( string: &str, ) -> Result<(&str, PlaintextType<N>), Err<VerboseError<&str>>>
Parses a string into a plaintext type.
Source§impl<N> Parser for RegisterType<N>where
N: Network,
impl<N> Parser for RegisterType<N>where
N: Network,
Source§fn parse(
string: &str,
) -> Result<(&str, RegisterType<N>), Err<VerboseError<&str>>>
fn parse( string: &str, ) -> Result<(&str, RegisterType<N>), Err<VerboseError<&str>>>
Parses a string into a register type.
Source§impl<N> Parser for Ciphertext<N>where
N: Network,
impl<N> Parser for Ciphertext<N>where
N: Network,
Source§fn parse(string: &str) -> Result<(&str, Ciphertext<N>), Err<VerboseError<&str>>>
fn parse(string: &str) -> Result<(&str, Ciphertext<N>), Err<VerboseError<&str>>>
Parses a string into an ciphertext.
Source§impl<N> Parser for Identifier<N>where
N: Network,
impl<N> Parser for Identifier<N>where
N: Network,
Source§impl<N> Parser for RecordType<N>where
N: Network,
impl<N> Parser for RecordType<N>where
N: Network,
Source§fn parse(string: &str) -> Result<(&str, RecordType<N>), Err<VerboseError<&str>>>
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;
Source§impl<N> Parser for StructType<N>where
N: Network,
impl<N> Parser for StructType<N>where
N: Network,
Source§fn parse(string: &str) -> Result<(&str, StructType<N>), Err<VerboseError<&str>>>
fn parse(string: &str) -> Result<(&str, StructType<N>), Err<VerboseError<&str>>>
Parses a struct as:
struct message:
owner as address;
amount as u64;