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>);
    fn pool(&self) -> OperationVc<NodeJsPool>;
    fn args(&self) -> &[ResolvedVc<JsonValue>];
    fn cwd(&self) -> Vc<FileSystemPath>;
    fn emit_error<'life0, 'life1, 'async_trait>(
        &'life0 self,
        error: StructuredError,
        pool: &'life1 NodeJsPool,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn info<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        state: &'life1 mut Self::State,
        data: Self::InfoMessage,
        pool: &'life2 NodeJsPool,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn request<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        state: &'life1 mut Self::State,
        data: Self::RequestMessage,
        pool: &'life2 NodeJsPool,
    ) -> Pin<Box<dyn Future<Output = Result<Self::ResponseMessage>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn finish<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _state: Self::State,
        _pool: &'life1 NodeJsPool,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn keep_alive(&self) -> bool { ... }
}

Required Associated Types§

Required Methods§

Source

fn compute(self, sender: Vc<JavaScriptStreamSender>)

Source

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

Source

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

Source

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

Source

fn emit_error<'life0, 'life1, 'async_trait>( &'life0 self, error: StructuredError, pool: &'life1 NodeJsPool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn info<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 mut Self::State, data: Self::InfoMessage, pool: &'life2 NodeJsPool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn request<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 mut Self::State, data: Self::RequestMessage, pool: &'life2 NodeJsPool, ) -> Pin<Box<dyn Future<Output = Result<Self::ResponseMessage>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn finish<'life0, 'life1, 'async_trait>( &'life0 self, _state: Self::State, _pool: &'life1 NodeJsPool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn keep_alive(&self) -> bool

Implementors§