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 70)
62fn produce(producer: usize, lockstep: &Lockstep) {
63 for round in 0..ROUNDS {
64 for i in 0..BATCH {
65 let event = Event {
66 producer,
67 seq: round * BATCH + i,
68 payload: [i as u8; 8],
69 };
70 let _ = PRODUCER.try_with(|p| p.push(event));
71 }
72 lockstep.batch_pushed.wait();
73 lockstep.sweep_done.wait();
74 }
75}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