pub struct ClosureSpawnHandler<F, DB: Database> { /* private fields */ }Expand description
A spawn handler that creates jobs based on a simple closure.
Implementations§
Trait Implementations§
Source§impl<F, DB> SpawnHandler<DB> for ClosureSpawnHandler<F, DB>
impl<F, DB> SpawnHandler<DB> for ClosureSpawnHandler<F, DB>
Source§fn spawn_jobs<'life0, 'async_trait>(
&'life0 self,
context: SpawnContext<DB>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Job>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn spawn_jobs<'life0, 'async_trait>(
&'life0 self,
context: SpawnContext<DB>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Job>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate child jobs based on the parent job’s context. Read more
Source§fn validate_spawn<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_parent_job: &'life1 Job,
_config: &'life2 SpawnConfig,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn validate_spawn<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_parent_job: &'life1 Job,
_config: &'life2 SpawnConfig,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Optional validation method called before spawning jobs. Read more
Source§fn on_spawn_complete<'life0, 'life1, 'async_trait>(
&'life0 self,
_result: &'life1 SpawnResult,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_spawn_complete<'life0, 'life1, 'async_trait>(
&'life0 self,
_result: &'life1 SpawnResult,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Optional post-spawn callback called after child jobs are enqueued. Read more
Auto Trait Implementations§
impl<F, DB> Freeze for ClosureSpawnHandler<F, DB>where
F: Freeze,
impl<F, DB> RefUnwindSafe for ClosureSpawnHandler<F, DB>where
F: RefUnwindSafe,
DB: RefUnwindSafe,
impl<F, DB> Send for ClosureSpawnHandler<F, DB>where
F: Send,
impl<F, DB> Sync for ClosureSpawnHandler<F, DB>
impl<F, DB> Unpin for ClosureSpawnHandler<F, DB>
impl<F, DB> UnsafeUnpin for ClosureSpawnHandler<F, DB>where
F: UnsafeUnpin,
impl<F, DB> UnwindSafe for ClosureSpawnHandler<F, DB>where
F: UnwindSafe,
DB: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more