pub trait ValueDefault:
Send
+ Sync
+ NonLocalValue
+ ValueDebug {
// Required method
fn value_default() -> Vc<Self>
where Self: Sized;
}
Expand description
Vc<T>
analog to the Default
trait.
Implementing this trait on T
will make Vc::default()
produce
T::value_default()
.
There are two ways to implement this trait:
- Annotating with
#[turbo_tasks::value_impl]
: this will makeVc::default()
always return the same underlying value (i.e. a singleton). - No annotations: this will make
Vc::default()
always return a different value.