Skip to main content

RuntimeModule

Trait RuntimeModule 

Source
pub trait RuntimeModule:
    Module
    + CustomSourceRuntimeModule
    + AttachableRuntimeModule
    + NamedRuntimeModule {
    // Required methods
    fn runtime_module_variables() -> &'static [&'static str]
       where Self: Sized;
    fn generate<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        context: &'life1 RuntimeModuleGenerateContext<'life2>,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided methods
    fn stage(&self) -> RuntimeModuleStage { ... }
    fn full_hash(&self) -> bool { ... }
    fn dependent_hash(&self) -> bool { ... }
    fn should_isolate(&self, runtime_mode: RuntimeMode) -> bool { ... }
    fn template(&self) -> Vec<(String, String)> { ... }
    fn generate_with_custom<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        context: &'life1 RuntimeModuleGenerateContext<'life2>,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn runtime_requirements(
        &self,
        _compilation: &Compilation,
    ) -> RuntimeModuleRuntimeRequirements { ... }
}

Required Methods§

Source

fn runtime_module_variables() -> &'static [&'static str]
where Self: Sized,

Names that this runtime module may declare in the surrounding chunk scope.

Runtime modules backed by EJS templates should derive these names from top-level var() and fn() declarations. #[impl_runtime_module] registers the provider so the names can be reserved before runtime module instances are created.

Source

fn generate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, context: &'life1 RuntimeModuleGenerateContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Provided Methods§

Source

fn stage(&self) -> RuntimeModuleStage

Source

fn full_hash(&self) -> bool

Source

fn dependent_hash(&self) -> bool

Source

fn should_isolate(&self, runtime_mode: RuntimeMode) -> bool

Source

fn template(&self) -> Vec<(String, String)>

Source

fn generate_with_custom<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, context: &'life1 RuntimeModuleGenerateContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn runtime_requirements( &self, _compilation: &Compilation, ) -> RuntimeModuleRuntimeRequirements

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§