pub trait EvaluateContext {
type InfoMessage: DeserializeOwned;
type RequestMessage: DeserializeOwned;
type ResponseMessage: Serialize;
type State: Default;
// Required methods
fn compute(
self,
sender: Vc<JavaScriptStreamSender>,
) -> impl Future<Output = Result<()>> + Send;
fn pool(&self) -> OperationVc<NodeJsPool>;
fn args(&self) -> &[ResolvedVc<JsonValue>];
fn cwd(&self) -> Vc<FileSystemPath>;
fn emit_error(
&self,
error: StructuredError,
pool: &NodeJsPool,
) -> impl Future<Output = Result<()>> + Send;
fn info(
&self,
state: &mut Self::State,
data: Self::InfoMessage,
pool: &NodeJsPool,
) -> impl Future<Output = Result<()>> + Send;
fn request(
&self,
state: &mut Self::State,
data: Self::RequestMessage,
pool: &NodeJsPool,
) -> impl Future<Output = Result<Self::ResponseMessage>> + Send;
fn finish(
&self,
state: Self::State,
pool: &NodeJsPool,
) -> impl Future<Output = Result<()>> + Send;
// Provided method
fn keep_alive(&self) -> bool { ... }
}
Required Associated Types§
type InfoMessage: DeserializeOwned
type RequestMessage: DeserializeOwned
type ResponseMessage: Serialize
type State: Default
Required Methods§
fn compute( self, sender: Vc<JavaScriptStreamSender>, ) -> impl Future<Output = Result<()>> + Send
fn pool(&self) -> OperationVc<NodeJsPool>
fn args(&self) -> &[ResolvedVc<JsonValue>]
fn cwd(&self) -> Vc<FileSystemPath>
fn emit_error( &self, error: StructuredError, pool: &NodeJsPool, ) -> impl Future<Output = Result<()>> + Send
fn info( &self, state: &mut Self::State, data: Self::InfoMessage, pool: &NodeJsPool, ) -> impl Future<Output = Result<()>> + Send
fn request( &self, state: &mut Self::State, data: Self::RequestMessage, pool: &NodeJsPool, ) -> impl Future<Output = Result<Self::ResponseMessage>> + Send
fn finish( &self, state: Self::State, pool: &NodeJsPool, ) -> impl Future<Output = Result<()>> + Send
Provided Methods§
fn keep_alive(&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.