pub trait Module:
Send
+ Sync
+ NonLocalValue
+ ValueDebug {
// Required methods
fn ident(self: Vc<Self>) -> Vc<AssetIdent>
where Self: Sized;
fn source(self: Vc<Self>) -> Vc<OptionSource>
where Self: Sized;
fn side_effects(self: Vc<Self>) -> Vc<ModuleSideEffects>
where Self: Sized;
// Provided methods
fn ident_string(self: Vc<Self>) -> Vc<RcStr>
where Self: Sized { ... }
fn references(self: Vc<Self>) -> Vc<ModuleReferences>
where Self: Sized { ... }
fn is_self_async(self: Vc<Self>) -> Vc<bool>
where Self: Sized { ... }
}Expand description
A module. This usually represents parsed source code, which has references to other modules.
For documentation about where this is used and how it fits into the rest of Turbopack, see
crate::_layers.
Required Methods§
Sourcefn side_effects(self: Vc<Self>) -> Vc<ModuleSideEffects>where
Self: Sized,
fn side_effects(self: Vc<Self>) -> Vc<ModuleSideEffects>where
Self: Sized,
Returns true if the module is marked as free of side effects in
package.json or by other means.
Provided Methods§
Sourcefn references(self: Vc<Self>) -> Vc<ModuleReferences>where
Self: Sized,
fn references(self: Vc<Self>) -> Vc<ModuleReferences>where
Self: Sized,
Other Modules or OutputAssets referenced from this Module.
Trait Implementations§
impl Dynamic<Box<dyn Module>> for Box<dyn EvaluatableAsset>
impl Dynamic<Box<dyn Module>> for Box<dyn ChunkableModule>
impl Dynamic<Box<dyn Module>> for Box<dyn MergeableModule>
impl Dynamic<Box<dyn Module>> for Box<dyn Module>
impl Dynamic<Box<dyn Module>> for Box<dyn StyleModule>
impl Dynamic<Box<dyn ValueDebug>> for Box<dyn Module>
Available on debug-assertions enabled only.
impl Upcast<Box<dyn Module>> for Box<dyn EvaluatableAsset>
impl Upcast<Box<dyn Module>> for Box<dyn ChunkableModule>
impl Upcast<Box<dyn Module>> for Box<dyn MergeableModule>
impl Upcast<Box<dyn Module>> for Box<dyn Module>
impl Upcast<Box<dyn Module>> for Box<dyn StyleModule>
impl Upcast<Box<dyn Module>> for NodeAddonModule
impl Upcast<Box<dyn Module>> for RawModule
impl Upcast<Box<dyn ValueDebug>> for Box<dyn Module>
Available on debug-assertions enabled only.
impl UpcastStrict<Box<dyn Module>> for Box<dyn EvaluatableAsset>
impl UpcastStrict<Box<dyn Module>> for Box<dyn ChunkableModule>
impl UpcastStrict<Box<dyn Module>> for Box<dyn MergeableModule>
impl UpcastStrict<Box<dyn Module>> for Box<dyn StyleModule>
impl UpcastStrict<Box<dyn Module>> for NodeAddonModule
impl UpcastStrict<Box<dyn Module>> for RawModule
impl UpcastStrict<Box<dyn ValueDebug>> for Box<dyn Module>
Available on debug-assertions enabled only.
Source§impl VcValueTrait for Box<dyn Module>
impl VcValueTrait for Box<dyn Module>
Source§const IMPL_VTABLES: &'static VTableRegistry<Self::ValueTrait>
const IMPL_VTABLES: &'static VTableRegistry<Self::ValueTrait>
The per-trait vtable registry, populated by [crate::value_type::register_all_trait_methods] Read more
type ValueTrait = dyn Module
Source§fn get_trait_type_id() -> TraitTypeId
fn get_trait_type_id() -> TraitTypeId
Returns the type id of the trait object.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".