Skip to main content

NativeInstance

Trait NativeInstance 

Source
pub trait NativeInstance: Send {
    // Required methods
    fn classify(
        &self,
        error: &(dyn Error + Sync + Send + 'static),
    ) -> FailureKind;
    fn initialize(
        &mut self,
        context: ExecutionContext,
    ) -> Pin<Box<dyn Future<Output = Result<(), ServingError>> + Send + '_>>;
    fn run(
        &mut self,
        context: ExecutionContext,
    ) -> Pin<Box<dyn Future<Output = Result<ErasedResponse, ServingError>> + Send + '_>>;
    fn stop(
        &mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), ServingError>> + Send + '_>>;
    fn cleanup(
        &mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), ServingError>> + Send + '_>>;
    fn transferred(&self) -> bool;
}

Required Methods§

Source

fn classify(&self, error: &(dyn Error + Sync + Send + 'static)) -> FailureKind

Source

fn initialize( &mut self, context: ExecutionContext, ) -> Pin<Box<dyn Future<Output = Result<(), ServingError>> + Send + '_>>

Source

fn run( &mut self, context: ExecutionContext, ) -> Pin<Box<dyn Future<Output = Result<ErasedResponse, ServingError>> + Send + '_>>

Source

fn stop( &mut self, ) -> Pin<Box<dyn Future<Output = Result<(), ServingError>> + Send + '_>>

Source

fn cleanup( &mut self, ) -> Pin<Box<dyn Future<Output = Result<(), ServingError>> + Send + '_>>

Source

fn transferred(&self) -> bool

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§