pub fn queue_from<T, S>(storage: S) -> (Reader<S>, Writer<S>)where
S: Storage<T>,
Available on crate feature
blocking
only.Expand description
Creates a queue that is backed by a specific storage. The queue will use the storage’s entire capacity, and will be initialized with an empty read buffer and a full write buffer.
Note that the reader and writer will only implement Send
and Sync
if the storage also
does.
§Example
use mini_io_queue::blocking::queue_from;
use mini_io_queue::storage::HeapBuffer;
let buffer = HeapBuffer::<u8>::new(100);
let (reader, writer) = queue_from(buffer);
Sync
std::marker::Sync