Trait glsl::parser::Parse

source ·
pub trait Parse: Sized {
    fn parse<B>(source: B) -> ParseResult<Self>
    where
        B: AsRef<[u8]>
; fn parse_str<S>(source: S) -> ParseResult<Self>
    where
        S: AsRef<str>
, { ... } }
Expand description

Class of types that can be parsed.

This trait exposes two methods:

If you want to implement Parse, only Parse::parse is mandatory – Parse::parse_str has a default implementation using Parse::parse.

The methods from this trait are the standard way to parse data into GLSL ASTs.

Required Methods§

Parse from a byte slice.

Provided Methods§

Parse from a string.

Implementors§