Skip to main content

Delivery

Trait Delivery 

Source
pub trait Delivery: Send {
    // Required method
    fn deliver<'a>(
        &'a mut self,
        job: Box<dyn JobHandle>,
    ) -> BoxedFuture<'a, Result<()>>;
}
Expand description

The delivery callable Outbox::run_once takes.

A consumer-supplied async callable taking Box<dyn JobHandle>, returning the boxed future of Result<()> (ADR-019 §5). Object safety encoded as a named one-method trait object. Outcome posture: Ok ⇒ the engine acks the claim; Err(e) ⇒ the engine retries with the queue’s curve (retry(err, None)).

No engine-issued heartbeat inside delivery — the boxed JobHandle’s own heartbeat remains available to the closure; renewal inside the deadline is the consumer’s obligation.

Required Methods§

Source

fn deliver<'a>( &'a mut self, job: Box<dyn JobHandle>, ) -> BoxedFuture<'a, Result<()>>

Process the claimed job’s work. Returns the boxed future of Result<()>.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§