Skip to main content

Source

Trait Source 

Source
pub trait Source:
    Asset
    + Send
    + Sync
    + NonLocalValue
    + ValueDebug {
    // Required methods
    fn ident(self: Vc<Self>) -> Vc<AssetIdent>
       where Self: Sized;
    fn description(self: Vc<Self>) -> Vc<RcStr>
       where Self: Sized;
}
Expand description

Unparsed input source code. Source code is processed into Modules by the AssetContext. All Sources have content and an identifier.

For documentation about where this is used and how it fits into the rest of Turbopack, see crate::_layers.

Required Methods§

Source

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

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

Source

fn description(self: Vc<Self>) -> Vc<RcStr>
where Self: Sized,

A human-readable description of this source, explaining where the code comes from. For sources that transform another source, this should include the inner source’s description, creating a readable chain like "loaders [sass-loader] transform of file content of ./styles.scss".

Trait Implementations§

Source§

impl TraitVtablePrototype for Box<dyn Source>

Source§

const LEN: usize = 2usize

Source§

const DEFAULTS: &[Option<&NativeFunction>]

Source§

impl VcValueTrait for Box<dyn Source>

Source§

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 more
Source§

type ValueTrait = dyn Source

Source§

fn get_trait_type_id() -> TraitTypeId

Returns the type id of the trait object.
Source§

impl Dynamic<Box<dyn Asset>> for Box<dyn Source>

Source§

impl Dynamic<Box<dyn Source>> for Box<dyn Source>

Source§

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

Available on debug-assertions enabled only.
Source§

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

Source§

impl Upcast<Box<dyn Source>> for Box<dyn Source>

Source§

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

Available on debug-assertions enabled only.
Source§

impl UpcastStrict<Box<dyn Asset>> for Box<dyn Source>

Source§

impl UpcastStrict<Box<dyn ValueDebug>> for Box<dyn Source>

Available on debug-assertions enabled only.

Implementors§