turbopack_core/introspect/
mod.rs

1pub mod module;
2pub mod output_asset;
3pub mod source;
4pub mod utils;
5
6use turbo_rcstr::RcStr;
7use turbo_tasks::{FxIndexSet, ResolvedVc, Vc};
8
9type VcDynIntrospectable = ResolvedVc<Box<dyn Introspectable>>;
10
11#[turbo_tasks::value(transparent)]
12pub struct IntrospectableChildren(FxIndexSet<(RcStr, VcDynIntrospectable)>);
13
14#[turbo_tasks::value_trait]
15pub trait Introspectable {
16    #[turbo_tasks::function]
17    fn ty(self: Vc<Self>) -> Vc<RcStr>;
18    #[turbo_tasks::function]
19    fn title(self: Vc<Self>) -> Vc<RcStr> {
20        Vc::<RcStr>::default()
21    }
22    #[turbo_tasks::function]
23    fn details(self: Vc<Self>) -> Vc<RcStr> {
24        Vc::<RcStr>::default()
25    }
26    #[turbo_tasks::function]
27    fn children(self: Vc<Self>) -> Vc<IntrospectableChildren> {
28        Vc::cell(FxIndexSet::default())
29    }
30}