pub struct EventProducer<M> { /* private fields */ }Expand description
The owning thread’s write handle, stored in a thread_local.
Implementations§
Source§impl<M> EventProducer<M>
impl<M> EventProducer<M>
Sourcepub fn push(&self, m: M)
pub fn push(&self, m: M)
Appends one event: a plain slot store plus a Release publish of the
new length. Allocates a fresh chunk every CHUNK_SIZE events.
Examples found in repository?
examples/throughput.rs (line 67)
59fn produce(producer: usize, lockstep: &Lockstep) {
60 for round in 0..ROUNDS {
61 for i in 0..BATCH {
62 let event = Event {
63 producer,
64 seq: round * BATCH + i,
65 payload: Box::new([i as u8; 16]),
66 };
67 let _ = PRODUCER.try_with(|p| p.push(event));
68 }
69 lockstep.batch_pushed.wait();
70 lockstep.sweep_done.wait();
71 }
72}Trait Implementations§
Source§impl<M> Drop for EventProducer<M>
impl<M> Drop for EventProducer<M>
Auto Trait Implementations§
impl<M> !Freeze for EventProducer<M>
impl<M> !RefUnwindSafe for EventProducer<M>
impl<M> !Send for EventProducer<M>
impl<M> !Sync for EventProducer<M>
impl<M> !UnwindSafe for EventProducer<M>
impl<M> Unpin for EventProducer<M>
impl<M> UnsafeUnpin for EventProducer<M>
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