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§
Sourcetype Input: InputKind
type Input: InputKind
The input kind of one batch element (see BatchDef::Input).
Sourcetype Injections
type Injections
Required Methods§
Provided Methods§
Sourcefn workers(&self) -> Workers
fn workers(&self) -> Workers
The concurrency policy for this subscriber’s dispatch loop (how many batches are in flight at once).
Sourcefn failure_policies(&self) -> FailurePolicies
fn failure_policies(&self) -> FailurePolicies
The failure policy for a batch-handler panic and a per-element decode failure.
Sourcefn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
An optional human description (from the handler’s doc comment), for AsyncAPI.
Sourcefn input_schema(&self) -> Option<String>
fn input_schema(&self) -> Option<String>
The element type’s serialized JSON Schema, when available.
Sourcefn message_name(&self) -> Option<&'static str>
fn message_name(&self) -> Option<&'static str>
The element type’s Message name, when it implements that trait.
Sourcefn message_description(&self) -> Option<&'static str>
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".