pub struct MMapMetaFixedSubscriber<'a, SlotType: 'a> { /* private fields */ }
Expand description

A subscriber that follows a “fixed” tail – used on followers of “old” events, as opposed to MMapMetaDynamicSubscriber, which may yield “new” events as well

Trait Implementations§

source§

impl<'a, SlotType: 'a + Debug> MetaSubscriber<'a, SlotType> for MMapMetaFixedSubscriber<'a, SlotType>

source§

fn consume<GetterReturnType: 'a, GetterFn: FnOnce(&'a SlotType) -> GetterReturnType, ReportEmptyFn: Fn() -> bool, ReportLenAfterDequeueingFn: FnOnce(i32)>( &self, getter_fn: GetterFn, report_empty_fn: ReportEmptyFn, report_len_after_dequeueing_fn: ReportLenAfterDequeueingFn ) -> Option<GetterReturnType>

Zero-copy dequeue method with the following characteristics: Read more
source§

fn consume_leaking(&'a self) -> Option<(&'a SlotType, u32)>

Advanced method to “consume” the next element from the pool, returning a reference to the data.
The slot in which the data sits won’t be put back into the pool (for reuse) until [release_leaked()] is called.
Please notice that misuse of this method may bring the underlying container into an unusable state, as it may run out of slots for new elements to be published in.
IMPLEMENTORS: #[inline(always)]
source§

fn release_leaked_ref(&'a self, _slot: &'a SlotType)

Put the slot returned by [consume_leaking()] back into the pool, so it may be reused.
See the mentioned method for more info. IMPLEMENTORS: #[inline(always)]
source§

fn release_leaked_id(&'a self, _slot_id: u32)

The same as [release_leaked_ref()], but slightly more efficient IMPLEMENTORS: #[inline(always)]
source§

fn remaining_elements_count(&self) -> usize

Returns the same information as [MetaPublisher::available_elements_count()] for implementors that doesn’t allow several subscribers; For those that allow it (that is, use the “Listener Pattern”), returns how much elements are left for consumption IMPLEMENTORS: #[inline(always)]
source§

unsafe fn peek_remaining(&self) -> Vec<&SlotType>

Considering parallelism, this method might provide access to all elements available for [consume()].
This method is totally not thread safe for ring-buffer based implementations – the moment it returns, all those elements might have already been consumed (furthermore, by the time the references are used, several generations of elements might have already lived and died at those slots). It is, thought, safe for unbounded implementations that never collect published elements, like a log_topic
… So, use this method only when you’re sure the publishing / consumption operations won’t interfere with the results – for this reason, this method is marked as unsafe (it is only safe – and consistent – to call this method if you’re behind a lock guarding against these mentioned scenarios).

Auto Trait Implementations§

§

impl<'a, SlotType> RefUnwindSafe for MMapMetaFixedSubscriber<'a, SlotType>where SlotType: RefUnwindSafe,

§

impl<'a, SlotType> Send for MMapMetaFixedSubscriber<'a, SlotType>where SlotType: Send,

§

impl<'a, SlotType> Sync for MMapMetaFixedSubscriber<'a, SlotType>where SlotType: Sync,

§

impl<'a, SlotType> Unpin for MMapMetaFixedSubscriber<'a, SlotType>

§

impl<'a, SlotType> !UnwindSafe for MMapMetaFixedSubscriber<'a, SlotType>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Erased for T