File size: 609 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use turbo_tasks::Vc;

use crate::{self as turbo_tasks};

/// `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:
/// 1. Annotating with `#[turbo_tasks::value_impl]`: this will make `Vc::default()` always return
///    the same underlying value (i.e. a singleton).
/// 2. No annotations: this will make `Vc::default()` always return a different value.
#[turbo_tasks::value_trait]
pub trait ValueDefault {
    #[turbo_tasks::function]
    fn value_default() -> Vc<Self>;
}