Trait ChunkItem

Source
pub trait ChunkItem:
    Send
    + Sync
    + NonLocalValue
    + ValueDebug {
    // Required methods
    fn asset_ident(self: Vc<Self>) -> Vc<AssetIdent>
       where Self: Sized;
    fn ty(self: Vc<Self>) -> Vc<Box<dyn ChunkType>>
       where Self: Sized;
    fn module(self: Vc<Self>) -> Vc<Box<dyn Module>>
       where Self: Sized;
    fn chunking_context(self: Vc<Self>) -> Vc<Box<dyn ChunkingContext>>
       where Self: Sized;

    // Provided methods
    fn content_ident(self: Vc<Self>) -> Vc<AssetIdent>
       where Self: Sized { ... }
    fn references(self: Vc<Self>) -> Vc<OutputAssets>
       where Self: Sized { ... }
}

Required Methods§

Source

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

The AssetIdent of the Module that this ChunkItem was created from. For most chunk types this must uniquely identify the chunk item at runtime as it’s the source of the module id used at runtime.

Source

fn ty(self: Vc<Self>) -> Vc<Box<dyn ChunkType>>
where Self: Sized,

The type of chunk this item should be assembled into.

Source

fn module(self: Vc<Self>) -> Vc<Box<dyn Module>>
where Self: Sized,

A temporary method to retrieve the module associated with this ChunkItem. TODO: Remove this as part of the chunk refactoring.

Source

fn chunking_context(self: Vc<Self>) -> Vc<Box<dyn ChunkingContext>>
where Self: Sized,

Provided Methods§

Source

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

A AssetIdent that uniquely identifies the content of this ChunkItem. It is unusally identical to ChunkItem::asset_ident but can be different when the chunk item content depends on available modules e. g. for chunk loaders.

Source

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

A ChunkItem can reference OutputAssets, unlike Modules referencing other Modules.

Trait Implementations§

Implementors§