Trait EvaluateContext

Source
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§

Required Methods§

Source

fn compute( self, sender: Vc<JavaScriptStreamSender>, ) -> impl Future<Output = Result<()>> + Send

Source

fn pool(&self) -> OperationVc<NodeJsPool>

Source

fn args(&self) -> &[ResolvedVc<JsonValue>]

Source

fn cwd(&self) -> Vc<FileSystemPath>

Source

fn emit_error( &self, error: StructuredError, pool: &NodeJsPool, ) -> impl Future<Output = Result<()>> + Send

Source

fn info( &self, state: &mut Self::State, data: Self::InfoMessage, pool: &NodeJsPool, ) -> impl Future<Output = Result<()>> + Send

Source

fn request( &self, state: &mut Self::State, data: Self::RequestMessage, pool: &NodeJsPool, ) -> impl Future<Output = Result<Self::ResponseMessage>> + Send

Source

fn finish( &self, state: Self::State, pool: &NodeJsPool, ) -> impl Future<Output = Result<()>> + Send

Provided Methods§

Source

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.

Implementors§