pub struct FastQueue<T> { /* private fields */ }Expand description
A fast lock-free single-producer, single-consumer queue
Implementations§
Source§impl<T> FastQueue<T>
impl<T> FastQueue<T>
Sourcepub fn new(capacity: usize) -> (Producer<T>, Consumer<T>)
pub fn new(capacity: usize) -> (Producer<T>, Consumer<T>)
Creates a SPSC queue with the given capacity. The allocated capacity may be higher.
Capacity is rounded to the next power of two. The minimum allocated capacity is 2.
§Example
use fq::FastQueue;
struct Message {
from: String,
value: usize,
}
let (producer, consumer) = FastQueue::<Message>::new(2);Trait Implementations§
impl<T: Send> Send for FastQueue<T>
impl<T: Send> Sync for FastQueue<T>
Auto Trait Implementations§
impl<T> !Freeze for FastQueue<T>
impl<T> RefUnwindSafe for FastQueue<T>where
T: RefUnwindSafe,
impl<T> Unpin for FastQueue<T>where
T: Unpin,
impl<T> UnsafeUnpin for FastQueue<T>
impl<T> UnwindSafe for FastQueue<T>where
T: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more