queue-ext
English | 简体中文
queue-ext provides extended features for queues, allowing conversion of the pop() function to a Stream and the push() function to a Sender. It serves as a foundational building block for async channel implementations.
Features
- Convert queue
pop()into aStreamimplementation - Convert queue
push()into aSink/Senderimplementation - Type-erased channel API via
queue_channel() QueueExttrait for easy integration with any queue typeSendErrortype withfullanddisconnectedvariants- Supports arbitrary queue backends (SegQueue, VecDeque, etc.)
- Thread-safe (
Send+Sync)
Cargo Feature Flags
This crate has no Cargo feature flags. All functionality is enabled by default.
Basic Usage
use ;
use Poll;
use Arc;
use SegQueue;
let queue = new;
let = queue.;
tx.try_send.unwrap;
assert_eq!;
More Examples
Tests
41 tests covering Sink/Stream impl, SendError, drop semantics, and Send/Sync safety.
License
Licensed under either of Apache License 2.0 or MIT license at your option.