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<(ResolvedVc<RcStr>, VcDynIntrospectable)>);
13
14#[turbo_tasks::value_trait]
15pub trait Introspectable {
16    fn ty(self: Vc<Self>) -> Vc<RcStr>;
17    fn title(self: Vc<Self>) -> Vc<RcStr> {
18        Vc::<RcStr>::default()
19    }
20    fn details(self: Vc<Self>) -> Vc<RcStr> {
21        Vc::<RcStr>::default()
22    }
23    fn children(self: Vc<Self>) -> Vc<IntrospectableChildren> {
24        Vc::cell(FxIndexSet::default())
25    }
26}