Skip to main content

Parse

Trait Parse 

Source
pub trait Parse: Sized {
    // Required method
    fn parse(
        self,
        warnings_as_errors: bool,
        source_manager: Arc<dyn SourceManager>,
    ) -> Result<Box<Module>, Report>;
}
Expand description

This trait is meant to be implemented by any type that can be parsed to a Module, to allow methods which expect a Module to accept things like:

  • A Module which was previously parsed or deserialized
  • A string representing the source code of a Module.
  • A path to a file containing the source code of a Module.
  • A vector of crate::ast::Forms comprising the contents of a Module.

Required Methods§

Source

fn parse( self, warnings_as_errors: bool, source_manager: Arc<dyn SourceManager>, ) -> Result<Box<Module>, Report>

Parse (or convert) self into an executable Module.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Parse for &Path

Available on crate feature std only.
Source§

fn parse( self, warnings_as_errors: bool, source_manager: Arc<dyn SourceManager>, ) -> Result<Box<Module>, Report>

Source§

impl Parse for &String

Source§

fn parse( self, warnings_as_errors: bool, source_manager: Arc<dyn SourceManager>, ) -> Result<Box<Module>, Report>

Source§

impl Parse for &str

Source§

fn parse( self, warnings_as_errors: bool, source_manager: Arc<dyn SourceManager>, ) -> Result<Box<Module>, Report>

Source§

impl Parse for Arc<Module>

Source§

fn parse( self, _warnings_as_errors: bool, _source_manager: Arc<dyn SourceManager>, ) -> Result<Box<Module>, Report>

Source§

impl Parse for Arc<SourceFile>

Source§

fn parse( self, warnings_as_errors: bool, source_manager: Arc<dyn SourceManager>, ) -> Result<Box<Module>, Report>

Source§

impl Parse for Box<Module>

Source§

fn parse( self, _warnings_as_errors: bool, _source_manager: Arc<dyn SourceManager>, ) -> Result<Box<Module>, Report>

Source§

impl Parse for Box<str>

Source§

fn parse( self, warnings_as_errors: bool, source_manager: Arc<dyn SourceManager>, ) -> Result<Box<Module>, Report>

Source§

impl Parse for Cow<'_, str>

Source§

fn parse( self, warnings_as_errors: bool, source_manager: Arc<dyn SourceManager>, ) -> Result<Box<Module>, Report>

Source§

impl Parse for PathBuf

Available on crate feature std only.
Source§

fn parse( self, warnings_as_errors: bool, source_manager: Arc<dyn SourceManager>, ) -> Result<Box<Module>, Report>

Source§

impl Parse for String

Source§

fn parse( self, warnings_as_errors: bool, source_manager: Arc<dyn SourceManager>, ) -> Result<Box<Module>, Report>

Implementors§