Trait Parsable

Source
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§

Provided Methods§

Source

fn parse_item_without_consuming_spaces( reader: &mut StringReader, ) -> Option<Self>

Source

fn parse_item_with_separator( reader: &mut StringReader, separator: &'static str, ) -> Option<Self>

Source

fn location(&self) -> &ItemLocation

Source

fn get_completion_suggestions() -> &'static [&'static str]

Source

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.

Implementations on Foreign Types§

Source§

impl Parsable for ()

Source§

impl<T: Parsable> Parsable for Option<T>

Source§

impl<T: Parsable> Parsable for Box<T>

Source§

impl<T: Parsable> Parsable for Vec<T>

Source§

fn parse_item(reader: &mut StringReader) -> Option<Self>

Source§

fn parse_item_without_consuming_spaces( reader: &mut StringReader, ) -> Option<Self>

Source§

fn get_item_name() -> String

Source§

fn parse_item_with_separator( reader: &mut StringReader, separator: &'static str, ) -> Option<Self>

Source§

impl<T: Parsable, U: Parsable> Parsable for (T, U)

Implementors§