pub struct TurboStreamer { /* private fields */ }Expand description
Reusable single-threaded generator optimized for hot loops.
TurboStreamer owns its generator state and a reusable buffer. It avoids
thread-local lookup on every ID and amortizes clock reads across refills.
Implementations§
Source§impl TurboStreamer
impl TurboStreamer
pub fn new(size: usize) -> Self
pub fn try_new(size: usize) -> Result<Self, Error>
pub fn next_id(&mut self) -> Snid
pub fn next_unchecked(&mut self) -> Snid
pub fn refill(&mut self)
pub fn remaining(&self) -> usize
pub fn capacity(&self) -> usize
pub fn buffer(&self) -> &[Snid]
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TurboStreamer
impl RefUnwindSafe for TurboStreamer
impl Send for TurboStreamer
impl Sync for TurboStreamer
impl Unpin for TurboStreamer
impl UnsafeUnpin for TurboStreamer
impl UnwindSafe for TurboStreamer
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