Skip to main content

WorkerInit

Trait WorkerInit 

Source
pub trait WorkerInit {
    type Error;

    // Required method
    fn initialize(&self, worker: &WorkerContext) -> Result<(), Self::Error>;
}
Expand description

Initializes one worker after its context becomes active.

The default serial loader imposes no thread-safety bound; positive worker execution requires a shared Send + Sync initializer.

Required Associated Types§

Source

type Error

Initialization failure.

Required Methods§

Source

fn initialize(&self, worker: &WorkerContext) -> Result<(), Self::Error>

Initializes worker once for its worker lifecycle.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§