pub trait Module:
Asset
+ Send
+ Sync
+ NonLocalValue
+ ValueDebug {
// Required method
fn ident(self: Vc<Self>) -> Vc<AssetIdent>
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 { ... }
fn is_marked_as_side_effect_free(
self: Vc<Self>,
_side_effect_free_packages: Vc<Glob>,
) -> Vc<bool>
where Self: Sized { ... }
}Expand description
A module. This usually represents parsed source code, which has references to other modules.
Required Methods§
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,
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.
Sourcefn is_marked_as_side_effect_free(
self: Vc<Self>,
_side_effect_free_packages: Vc<Glob>,
) -> Vc<bool>where
Self: Sized,
fn is_marked_as_side_effect_free(
self: Vc<Self>,
_side_effect_free_packages: Vc<Glob>,
) -> Vc<bool>where
Self: Sized,
Returns true if the module is marked as side effect free in package.json or by other means.
Trait Implementations§
Source§impl VcValueTrait for Box<dyn Module>
impl VcValueTrait for Box<dyn Module>
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.
Source§fn get_impl_vtables() -> &'static VTableRegistry<Self::ValueTrait>
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.