File size: 736 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
use turbo_tasks::{ResolvedVc, Vc};
use crate::{asset::Asset, ident::AssetIdent};
/// (Unparsed) Source Code. Source Code is processed into [Module]s by the
/// [AssetContext]. All [Source]s have content and an identifier.
#[turbo_tasks::value_trait]
pub trait Source: Asset {
/// The identifier of the [Source]. It's expected to be unique and capture
/// all properties of the [Source].
#[turbo_tasks::function]
fn ident(&self) -> Vc<AssetIdent>;
}
#[turbo_tasks::value(transparent)]
pub struct OptionSource(Option<ResolvedVc<Box<dyn Source>>>);
#[turbo_tasks::value(transparent)]
pub struct Sources(Vec<ResolvedVc<Box<dyn Source>>>);
// TODO All Vc::try_resolve_downcast::<Box<dyn Source>> calls should be removed
|