pub trait TransportReceiver: TransportBase {
type Token: CommitToken;
// Required methods
fn recv(
&self,
max: usize,
) -> impl Future<Output = TransportResult<RecvBatch<Self::Token>>> + Send;
fn commit(
&self,
tokens: &[Self::Token],
) -> impl Future<Output = TransportResult<()>> + Send;
}transport only.Expand description
Receive-side transport – generic over commit token type.
Extends TransportBase with receive and commit capability.
Input stages (receiver, fetcher) use concrete implementations
directly for type-safe token handling.
Required Associated Types§
Sourcetype Token: CommitToken
type Token: CommitToken
The token type for this transport.
Required Methods§
Sourcefn recv(
&self,
max: usize,
) -> impl Future<Output = TransportResult<RecvBatch<Self::Token>>> + Send
fn recv( &self, max: usize, ) -> impl Future<Output = TransportResult<RecvBatch<Self::Token>>> + Send
Receive up to max messages.
Returns immediately with available messages (may be fewer than max).
Returns an empty batch if no messages are available.
Filter behaviour: if the transport has inbound filters configured,
recv() removes messages matching action: drop filters and returns
messages matching action: dlq filters in RecvBatch.dlq_entries
alongside the passing RecvBatch.messages. Route the DLQ entries via
your own DLQ handle – they cannot be silently lost.
§Example
let batch = transport.recv(100).await?;
for entry in batch.dlq_entries {
dlq.send(DlqEntry::new("filter", entry.reason, entry.payload)).await?;
}
for msg in batch.messages { /* process */ }Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".