pub struct Publisher<T: Copy> { /* private fields */ }Expand description
The write side of a Photon SPMC channel.
There is exactly one Publisher per channel. It is Send but not Sync —
only one thread may publish at a time (single-producer guarantee enforced
by &mut self).
Implementations§
Source§impl<T: Copy> Publisher<T>
impl<T: Copy> Publisher<T>
Sourcepub fn publish_batch(&mut self, values: &[T])
pub fn publish_batch(&mut self, values: &[T])
Publish a batch of values with a single cursor update.
Each slot is written atomically (seqlock), but the cursor advances only once at the end — consumers see the entire batch appear at once, and cache-line bouncing on the shared cursor is reduced to one store.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Publisher<T>
impl<T> !RefUnwindSafe for Publisher<T>
impl<T> Sync for Publisher<T>where
T: Send,
impl<T> Unpin for Publisher<T>
impl<T> UnsafeUnpin for Publisher<T>
impl<T> !UnwindSafe for Publisher<T>
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