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 ident(self: Vc<Self>) -> Vc<AssetIdent>where
Self: Sized,
fn ident(self: Vc<Self>) -> Vc<AssetIdent>where
Self: Sized,
Sourcefn source(self: Vc<Self>) -> Vc<OptionSource>where
Self: Sized,
fn source(self: Vc<Self>) -> Vc<OptionSource>where
Self: Sized,
The source of the Module.
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 ident_string(self: Vc<Self>) -> Vc<RcStr>where
Self: Sized,
fn ident_string(self: Vc<Self>) -> Vc<RcStr>where
Self: Sized,
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.
Sourcefn is_self_async(self: Vc<Self>) -> Vc<bool>where
Self: Sized,
fn is_self_async(self: Vc<Self>) -> Vc<bool>where
Self: Sized,
Signifies the module itself is async, e.g. it uses top-level await, is a wasm module, etc.
Trait Implementations§
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 at program load by
#[ctor::ctor]
functions emitted by each #[turbo_tasks::value_impl] expansion. Read moretype ValueTrait = dyn Module
Source§fn get_trait_type_id() -> TraitTypeId
fn get_trait_type_id() -> TraitTypeId
Returns the type id of the trait object.
impl Dynamic<Box<dyn Module>> for Box<dyn Module>
impl Dynamic<Box<dyn ValueDebug>> for Box<dyn Module>
Available on debug-assertions enabled only.
impl Upcast<Box<dyn Module>> for Box<dyn Module>
impl Upcast<Box<dyn ValueDebug>> for Box<dyn Module>
Available on debug-assertions enabled only.
impl UpcastStrict<Box<dyn ValueDebug>> for Box<dyn Module>
Available on debug-assertions enabled only.