pub trait TaskInput:
Send
+ Sync
+ Clone
+ Debug
+ PartialEq
+ Eq
+ Hash
+ TraceRawVcs
+ Encode
+ Decode<()> {
// Required method
fn is_transient(&self) -> bool;
// Provided methods
fn resolve_input(&self) -> impl Future<Output = Result<Self>> + Send + '_ { ... }
fn is_resolved(&self) -> bool { ... }
}Expand description
Trait to implement in order for a type to be accepted as a
#[turbo_tasks::function] argument.
Transient task inputs are required to implement Encode and Decode, but are allowed to
panic at runtime. This requirement could be lifted in the future.
Bincode encoding must be deterministic and compatible with Eq comparisons. If two
TaskInputs compare equal they must also encode to the same bytes.
Required Methods§
fn is_transient(&self) -> bool
Provided Methods§
fn resolve_input(&self) -> impl Future<Output = Result<Self>> + Send + '_
fn is_resolved(&self) -> bool
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.