Trait Module

Source
pub trait Module:
    Asset
    + Send
    + Sync
    + NonLocalValue
    + ValueDebug {
    // Required method
    fn ident(self: Vc<Self>) -> Vc<AssetIdent>
       where Self: Sized;

    // Provided methods
    fn references(self: Vc<Self>) -> Vc<ModuleReferences>
       where Self: Sized { ... }
    fn is_self_async(self: Vc<Self>) -> Vc<bool>
       where Self: Sized { ... }
    fn style_type(self: Vc<Self>) -> Vc<OptionStyleType>
       where Self: Sized { ... }
}
Expand description

A module. This usually represents parsed source code, which has references to other modules.

Required Methods§

Source

fn ident(self: Vc<Self>) -> Vc<AssetIdent>
where Self: Sized,

The identifier of the Module. It’s expected to be unique and capture all properties of the Module.

Provided Methods§

Source

fn references(self: Vc<Self>) -> Vc<ModuleReferences>
where Self: Sized,

Other Modules or [OutputAsset]s referenced from this Module.

Source

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.

Source

fn style_type(self: Vc<Self>) -> Vc<OptionStyleType>
where Self: Sized,

The style type of the module.

Trait Implementations§

Source§

impl VcValueTrait for Box<dyn Module>

Source§

type ValueTrait = dyn Module

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 Module>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§