Trait lightningcss::traits::Parse
source · pub trait Parse<'i>: Sized {
fn parse<'t>(
input: &mut Parser<'i, 't>
) -> Result<Self, ParseError<'i, ParserError<'i>>>;
fn parse_string(
input: &'i str
) -> Result<Self, ParseError<'i, ParserError<'i>>> { ... }
}
Expand description
Trait for things that can be parsed from CSS syntax.
Required Methods§
sourcefn parse<'t>(
input: &mut Parser<'i, 't>
) -> Result<Self, ParseError<'i, ParserError<'i>>>
fn parse<'t>(
input: &mut Parser<'i, 't>
) -> Result<Self, ParseError<'i, ParserError<'i>>>
Parse a value of this type using an existing parser.
Provided Methods§
sourcefn parse_string(input: &'i str) -> Result<Self, ParseError<'i, ParserError<'i>>>
fn parse_string(input: &'i str) -> Result<Self, ParseError<'i, ParserError<'i>>>
Parse a value from a string.
(This is a convenience wrapper for parse
and probably should not be overridden.)