Skip to main content

FormatParser

Trait FormatParser 

Source
pub trait FormatParser {
    // Required method
    fn parse_str(&self, input: &str) -> Result<Value, BabbelError>;

    // Provided method
    fn parse_bytes(&self, input: &[u8]) -> Result<Value, BabbelError> { ... }
}
Expand description

Abstract parser converting text or byte inputs into a universal Value AST.

Required Methods§

Source

fn parse_str(&self, input: &str) -> Result<Value, BabbelError>

Parses a UTF-8 string into a universal Value.

Provided Methods§

Source

fn parse_bytes(&self, input: &[u8]) -> Result<Value, BabbelError>

Parses a raw byte slice into a universal Value.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§