pub trait Parsable: Sized {
// Required methods
fn parse_item(reader: &mut StringReader) -> Option<Self>;
fn get_item_name() -> String;
// Provided methods
fn parse_item_without_consuming_spaces(
reader: &mut StringReader,
) -> Option<Self> { ... }
fn parse_item_with_separator(
reader: &mut StringReader,
separator: &'static str,
) -> Option<Self> { ... }
fn location(&self) -> &ItemLocation { ... }
fn get_completion_suggestions() -> &'static [&'static str] { ... }
fn parse(string: String, options: ParseOptions) -> Result<Self, ParseError> { ... }
}Required Methods§
fn parse_item(reader: &mut StringReader) -> Option<Self>
fn get_item_name() -> String
Provided Methods§
fn parse_item_without_consuming_spaces( reader: &mut StringReader, ) -> Option<Self>
fn parse_item_with_separator( reader: &mut StringReader, separator: &'static str, ) -> Option<Self>
fn location(&self) -> &ItemLocation
fn get_completion_suggestions() -> &'static [&'static str]
fn parse(string: String, options: ParseOptions) -> Result<Self, ParseError>
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.