pub struct MCache<const DEPTH: usize> { /* private fields */ }Implementations§
Source§impl<const DEPTH: usize> MCache<DEPTH>
impl<const DEPTH: usize> MCache<DEPTH>
pub fn stop(&self)
pub fn is_running(&self) -> bool
Sourcepub fn publish(&self, meta: FragmentMetadata)
pub fn publish(&self, meta: FragmentMetadata)
Publish a fragment’s metadata into the ring.
Sourcepub fn wait(&self, seq: u64) -> ReadResult<FragmentMetadata>
pub fn wait(&self, seq: u64) -> ReadResult<FragmentMetadata>
Busy-wait for a specific sequence number to appear.
Returns:
ReadResult::Ok(meta)if the sequence was successfully readReadResult::Overrunif the consumer was lapped by the producerReadResult::NotReadyif the mcache was stopped before the sequence appeared
Sourcepub fn try_read(&self, seq: u64) -> ReadResult<FragmentMetadata>
pub fn try_read(&self, seq: u64) -> ReadResult<FragmentMetadata>
Attempt a lock-free read of the metadata at a specific sequence.
Returns:
ReadResult::Ok(meta)if the sequence was successfully readReadResult::NotReadyif the sequence has not been published yetReadResult::Overrunif the consumer was lapped by the producer
Trait Implementations§
Auto Trait Implementations§
impl<const DEPTH: usize> !Freeze for MCache<DEPTH>
impl<const DEPTH: usize> !RefUnwindSafe for MCache<DEPTH>
impl<const DEPTH: usize> Send for MCache<DEPTH>
impl<const DEPTH: usize> Sync for MCache<DEPTH>
impl<const DEPTH: usize> Unpin for MCache<DEPTH>
impl<const DEPTH: usize> UnsafeUnpin for MCache<DEPTH>
impl<const DEPTH: usize> UnwindSafe for MCache<DEPTH>
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