pub trait EvaluateContext {
type InfoMessage: DeserializeOwned;
type RequestMessage: DeserializeOwned;
type ResponseMessage: Serialize;
type State: Default;
// Required methods
fn pool(&self) -> OperationVc<EvaluatePool>;
fn args(&self) -> &[ResolvedVc<JsonValue>];
fn cwd(&self) -> Vc<FileSystemPath>;
fn emit_error(
&self,
error: StructuredError,
pool: &EvaluatePool,
) -> impl Future<Output = Result<()>> + Send;
fn info(
&self,
state: &mut Self::State,
data: Self::InfoMessage,
pool: &EvaluatePool,
) -> impl Future<Output = Result<()>> + Send;
fn request(
&self,
state: &mut Self::State,
data: Self::RequestMessage,
pool: &EvaluatePool,
) -> impl Future<Output = Result<Self::ResponseMessage>> + Send;
fn finish(
&self,
state: Self::State,
pool: &EvaluatePool,
) -> impl Future<Output = Result<()>> + Send;
// Provided methods
fn keep_alive(&self) -> bool { ... }
fn crash_context_prefix(&self) -> Option<RcStr> { ... }
}Required Associated Types§
type InfoMessage: DeserializeOwned
type RequestMessage: DeserializeOwned
type ResponseMessage: Serialize
type State: Default
Required Methods§
fn pool(&self) -> OperationVc<EvaluatePool>
fn args(&self) -> &[ResolvedVc<JsonValue>]
fn cwd(&self) -> Vc<FileSystemPath>
fn emit_error( &self, error: StructuredError, pool: &EvaluatePool, ) -> impl Future<Output = Result<()>> + Send
fn info( &self, state: &mut Self::State, data: Self::InfoMessage, pool: &EvaluatePool, ) -> impl Future<Output = Result<()>> + Send
fn request( &self, state: &mut Self::State, data: Self::RequestMessage, pool: &EvaluatePool, ) -> impl Future<Output = Result<Self::ResponseMessage>> + Send
fn finish( &self, state: Self::State, pool: &EvaluatePool, ) -> impl Future<Output = Result<()>> + Send
Provided Methods§
fn keep_alive(&self) -> bool
Sourcefn crash_context_prefix(&self) -> Option<RcStr>
fn crash_context_prefix(&self) -> Option<RcStr>
Optional human-readable prefix describing what was being evaluated,
included verbatim in the message of the synthetic StructuredError
emitted when the Node.js subprocess crashes mid-evaluation. For
webpack-loader evaluations this is the loader chain (“loaders
[foo, bar]”). The default returns None.
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.