[][src]Struct moore_svlog::GlobalContext

pub struct GlobalContext<'gcx> {
    pub sess: &'gcx Session,
    pub arena: &'gcx GlobalArenas<'gcx>,
    // some fields omitted
}

The central data structure of the compiler. It stores references to various arenas and tables that store the results of the various computations that have been performed.

Fields

sess: &'gcx Session

The global compiler session.

arena: &'gcx GlobalArenas<'gcx>

The arena that owns all references.

Implementations

impl<'gcx> GlobalContext<'gcx>[src]

pub fn new(sess: &'gcx Session, arena: &'gcx GlobalArenas<'gcx>) -> Self[src]

Create a new global context.

pub fn add_root(&self, root: &'gcx Root<'gcx>)[src]

Add an AST root to the context for processing.

Use the find_global_item function afterwards to look up the id of modules that were added.

pub fn add_files(&self, files: impl Iterator<Item = &'gcx SourceFile<'gcx>>)[src]

Add an AST root with a series of source files to the context for processing.

pub fn find_module(&self, name: Name) -> Option<NodeId>[src]

Find a module in the AST.

pub fn modules(&self) -> impl Iterator<Item = (Name, NodeId)>[src]

Get an iterator over all modules in the AST.

pub fn find_package(&self, name: Name) -> Option<NodeId>[src]

Find a package in the AST.

pub fn imports(&self) -> impl Iterator<Item = NodeId>[src]

Get an iterator over all root imports in the AST.

Trait Implementations

impl<'gcx> Context<'gcx> for GlobalContext<'gcx>[src]

impl DiagEmitter for GlobalContext<'_>[src]

impl<'gcx> HasTypeStorage<'gcx> for GlobalContext<'gcx>[src]

impl<'gcx> QueryDatabase<'gcx> for GlobalContext<'gcx>[src]

type Context = Self

The type passed as first argument to compiler query implementations. Read more

Auto Trait Implementations

impl<'gcx> !RefUnwindSafe for GlobalContext<'gcx>[src]

impl<'gcx> !Send for GlobalContext<'gcx>[src]

impl<'gcx> !Sync for GlobalContext<'gcx>[src]

impl<'gcx> Unpin for GlobalContext<'gcx>[src]

impl<'gcx> !UnwindSafe for GlobalContext<'gcx>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<'a, T> TypeContext<'a> for T where
    T: HasTypeStorage<'a>, 
[src]