pub trait WriteQueue: Send + Sync {
// Required method
fn enqueue<'a>(
&'a self,
write: QueuedWrite,
) -> Pin<Box<dyn Future<Output = Result<(), QueueError>> + Send + 'a>>;
// Provided method
fn enabled(&self) -> bool { ... }
}Expand description
A queue that durably accepts resolved write ops for downstream fan-out.
The implementor (a Kafka producer with a write-ahead log, in the shipped
binary) must only resolve the future Ok once the op is durably accepted, so
the 202 the pipeline returns is truthful. Implementations MUST NOT panic.
Required Methods§
Sourcefn enqueue<'a>(
&'a self,
write: QueuedWrite,
) -> Pin<Box<dyn Future<Output = Result<(), QueueError>> + Send + 'a>>
fn enqueue<'a>( &'a self, write: QueuedWrite, ) -> Pin<Box<dyn Future<Output = Result<(), QueueError>> + Send + 'a>>
Durably enqueues write, resolving Ok only once it is accepted.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".