pub trait Library {
    type ModuleIterator<'a>: Iterator<Item = &'a Module>
       where Self: 'a;

    // Required methods
    fn root_ns(&self) -> &LibraryNamespace;
    fn version(&self) -> &Version;
    fn modules(&self) -> Self::ModuleIterator<'_>;
    fn dependencies(&self) -> &[LibraryNamespace];

    // Provided method
    fn get_module_ast(&self, path: &LibraryPath) -> Option<&ModuleAst> { ... }
}
Expand description

A library definition that provides AST modules for the compilation process.

Required Associated Types§

source

type ModuleIterator<'a>: Iterator<Item = &'a Module> where Self: 'a

The concrete type used to iterate the modules of the library.

Required Methods§

source

fn root_ns(&self) -> &LibraryNamespace

Returns the root namespace of this library.

source

fn version(&self) -> &Version

Returns the version number of this library.

source

fn modules(&self) -> Self::ModuleIterator<'_>

Iterate the modules available in the library.

source

fn dependencies(&self) -> &[LibraryNamespace]

Returns the dependency libraries of this library.

Provided Methods§

source

fn get_module_ast(&self, path: &LibraryPath) -> Option<&ModuleAst>

Returns the AST of the module stored at the provided path.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> Library for &T
where T: Library,

Implementors§