Skip to content

Commit 000ec55

Browse files
committed
feat: add some comments
1 parent 492b911 commit 000ec55

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl<T> Drop for FastQueue<T> {
191191
}
192192
}
193193

194-
/// A producer for the `FastQueue`. This is used to push values into the queue.
194+
/// A producer for the `FastQueue`. This is used to send elements to the queue.
195195
pub struct Producer<T> {
196196
queue: CachePadded<Arc<FastQueue<T>>>,
197197
head: CachePadded<UnsafeCell<usize>>,
@@ -201,6 +201,7 @@ pub struct Producer<T> {
201201

202202
unsafe impl<T: Send> Send for Producer<T> {}
203203

204+
/// A producer for the `FastQueue`. This is used to send elements to the queue.
204205
impl<T> Producer<T> {
205206
/// Pushes a value into the queue. Returns `Ok(())` on success or `Err(T)` if the queue is full.
206207
///
@@ -318,6 +319,7 @@ impl<T> Producer<T> {
318319
}
319320
}
320321

322+
/// A consumer for the `FastQueue`. This is used to receive items from the queue.
321323
pub struct Consumer<T> {
322324
queue: CachePadded<Arc<FastQueue<T>>>,
323325
tail: CachePadded<UnsafeCell<usize>>,
@@ -327,7 +329,7 @@ pub struct Consumer<T> {
327329

328330
unsafe impl<T: Send> Send for Consumer<T> {}
329331

330-
/// A consumer for the `FastQueue`. This is used to pop values from the queue.
332+
/// A consumer for the `FastQueue`. This is used to receive items from the queue.
331333
impl<T> Consumer<T> {
332334
/// Pops a value from the queue. Returns `Some(T)` on success or `None` if the queue is empty.
333335
///

0 commit comments

Comments
 (0)