pub trait SourceLane: Send {
type Batch<'a>: PayloadBatch<'a>
where Self: 'a;
// Required methods
fn id(&self) -> LaneId;
fn partition(&self) -> PartitionId;
fn poll(
&mut self,
max_records: usize,
timeout: Duration,
) -> Result<Option<Self::Batch<'_>>, SourceError>;
}Expand description
Data-plane pollable unit of a source, owned by one pipeline thread.
Contract: payloads yielded by SourceLane::poll are valid only until
the returned batch is dropped, which happens before the next poll call
on the same lane. Records must be consumed or encoded within that
window (the operator chain guarantees this by construction).
Required Associated Types§
Sourcetype Batch<'a>: PayloadBatch<'a>
where
Self: 'a
type Batch<'a>: PayloadBatch<'a> where Self: 'a
The borrowed batch type (a GAT so payloads can borrow lane buffers).
Required Methods§
Sourcefn partition(&self) -> PartitionId
fn partition(&self) -> PartitionId
The source partition this lane reads. Used for checkpoint issuing and shard routing fallback.
Sourcefn poll(
&mut self,
max_records: usize,
timeout: Duration,
) -> Result<Option<Self::Batch<'_>>, SourceError>
fn poll( &mut self, max_records: usize, timeout: Duration, ) -> Result<Option<Self::Batch<'_>>, SourceError>
Poll up to max_records payloads, waiting at most timeout.
Ok(None) means nothing arrived; the driver treats it as idle.
Implementations must not busy-spin when idle; block up to timeout.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".