Skip to main content

ModuleCache

Trait ModuleCache 

Source
pub trait ModuleCache: Send + Sync {
    // Required methods
    fn get(&self, key: ModuleKey) -> Option<CachedModule>;
    fn put(&self, key: ModuleKey, module: CachedModule);
}
Expand description

A store of parse results the host owns and gives the analysis.

Both methods are called from the parallel parse step. A failed lookup, or a stored value the implementation cannot decode, is a miss (None), never an error.

Required Methods§

Source

fn get(&self, key: ModuleKey) -> Option<CachedModule>

The result stored under key, if any.

Source

fn put(&self, key: ModuleKey, module: CachedModule)

Stores module under key.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§