Trait MergeableModule

Source
pub trait MergeableModule:
    Module
    + Asset
    + Send
    + Sync
    + NonLocalValue
    + ValueDebug {
    // Required method
    fn merge(
        self: Vc<Self>,
        modules: Vc<MergeableModulesExposed>,
        entry_points: Vc<MergeableModules>,
    ) -> Vc<Box<dyn ChunkableModule>>
       where Self: Sized;

    // Provided method
    fn is_mergeable(self: Vc<Self>) -> Vc<bool>
       where Self: Sized { ... }
}
Expand description

A Module that can be merged with other Modules (to perform scope hoisting)

Required Methods§

Source

fn merge( self: Vc<Self>, modules: Vc<MergeableModulesExposed>, entry_points: Vc<MergeableModules>, ) -> Vc<Box<dyn ChunkableModule>>
where Self: Sized,

Create a new module representing the merged content of the given modules.

Group entry points are not referenced by any other module in the group. This list is needed because the merged module is created by recursively inlining modules when they are imported, but this process has to start somewhere (= with these entry points).

Provided Methods§

Source

fn is_mergeable(self: Vc<Self>) -> Vc<bool>
where Self: Sized,

Even though MergeableModule is implemented, this allows a dynamic condition to determine mergeability

Trait Implementations§

Source§

impl VcValueTrait for Box<dyn MergeableModule>

Source§

type ValueTrait = dyn MergeableModule

Source§

fn get_trait_type_id() -> TraitTypeId

Returns the type id of the trait object.
Source§

fn get_impl_vtables() -> &'static VTableRegistry<Self::ValueTrait>

Returns the vtable for an implementation of this trait. Panics if ValueTypeId does not implement the trait.
Source§

impl Dynamic<Box<dyn Asset>> for Box<dyn MergeableModule>

Source§

impl Dynamic<Box<dyn MergeableModule>> for Box<dyn MergeableModule>

Source§

impl Dynamic<Box<dyn Module>> for Box<dyn MergeableModule>

Source§

impl Dynamic<Box<dyn ValueDebug>> for Box<dyn MergeableModule>

Source§

impl Upcast<Box<dyn Asset>> for Box<dyn MergeableModule>

Source§

impl Upcast<Box<dyn MergeableModule>> for Box<dyn MergeableModule>

Source§

impl Upcast<Box<dyn Module>> for Box<dyn MergeableModule>

Source§

impl Upcast<Box<dyn ValueDebug>> for Box<dyn MergeableModule>

Implementors§