Skip to main content

BatchInjectDef

Trait BatchInjectDef 

Source
pub trait BatchInjectDef: Send + Sync {
    type Input: InputKind;
    type Source;
    type Injections;

    // Required method
    fn source(&self) -> Self::Source;

    // Provided methods
    fn workers(&self) -> Workers { ... }
    fn failure_policies(&self) -> FailurePolicies { ... }
    fn description(&self) -> Option<&str> { ... }
    fn input_schema(&self) -> Option<String> { ... }
    fn message_name(&self) -> Option<&'static str> { ... }
    fn message_description(&self) -> Option<&'static str> { ... }
}
Expand description

A batch definition whose handler takes startup-injected parameters.

Generated by #[subscriber(batch(..))] when the signature carries Out / Seek parameters; Self::Injections is their tuple, in declaration order. The metadata surface mirrors BatchDef.

Required Associated Types§

Source

type Input: InputKind

The input kind of one batch element (see BatchDef::Input).

Source

type Source

The subscription source this handler binds to.

Source

type Injections

The tuple of startup-injected parameters (Out, Seek, …).

Required Methods§

Source

fn source(&self) -> Self::Source

Builds the subscription source (fresh each call).

Provided Methods§

Source

fn workers(&self) -> Workers

The concurrency policy for this subscriber’s dispatch loop (how many batches are in flight at once).

Source

fn failure_policies(&self) -> FailurePolicies

The failure policy for a batch-handler panic and a per-element decode failure.

Source

fn description(&self) -> Option<&str>

An optional human description (from the handler’s doc comment), for AsyncAPI.

Source

fn input_schema(&self) -> Option<String>

The element type’s serialized JSON Schema, when available.

Source

fn message_name(&self) -> Option<&'static str>

The element type’s Message name, when it implements that trait.

Source

fn message_description(&self) -> Option<&'static str>

The element type’s Message description, when it implements that trait.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§