pub struct EvidentPublisher<K, M, T, F>where
    K: Id + CaptureControl,
    M: Msg,
    T: EventEntry<K, M>,
    F: Filter<K, M>,{ /* private fields */ }
Expand description

An EvidentPublisher is used to capture, publish, and manage subscriptions.

[req:pub]

Implementations§

source§

impl<K, M, T, F> EvidentPublisher<K, M, T, F>where K: Id + CaptureControl, M: Msg, T: EventEntry<K, M>, F: Filter<K, M>,

source

pub fn new( on_event: impl FnMut(Event<K, M, T>) + Send + 'static, capture_mode: CaptureMode, capture_channel_bound: usize, subscription_channel_bound: usize, time_stamp_kind: EventTimestampKind ) -> Self

Create a new EvidentPublisher without an event filter.

Note: You should use the macro create_static_publisher instead.

[req:pub]

source

pub fn with( on_event: impl FnMut(Event<K, M, T>) + Send + 'static, filter: F, capture_mode: CaptureMode, capture_channel_bound: usize, subscription_channel_bound: usize, timestamp_kind: EventTimestampKind ) -> Self

Create a new EvidentPublisher with an event filter.

Note: You should use the macro create_static_publisher instead.

[req:pub], [req:cap.filter]

source

pub fn get_filter(&self) -> &Option<F>

Returns the event filter, or None if no filter is set.

[req:cap.filter]

source

pub fn entry_allowed(&self, entry: &impl EventEntry<K, M>) -> bool

Returns true if the given event-entry passes the filter, or the event-ID is a control-ID.

[req:cap.filter]

source

pub fn get_capture_mode(&self) -> CaptureMode

Returns the current capture mode.

source

pub fn set_capture_mode(&self, mode: CaptureMode)

Allows to change the capture mode.

source

pub fn get_missed_captures(&self) -> usize

Returns the number of missed captures in non-blocking mode since last reset.

source

pub fn reset_missed_captures(&self)

Resets the number of missed captures in non-blocking mode.

source

pub fn subscribe( &self, id: K ) -> Result<Subscription<'_, K, M, T, F>, SubscriptionError<K>>

Returns a subscription to events with the given event-ID, or a SubscriptionError<K> if the subscription could not be created.

[req:subs.specific.one]

source

pub fn subscribe_to_many( &self, ids: Vec<K> ) -> Result<Subscription<'_, K, M, T, F>, SubscriptionError<K>>

Returns a subscription to events with the given event-IDs, or a SubscriptionError<K> if the subscription could not be created.

[req:subs.specific.mult]

source

pub fn subscribe_to_all_events( &self ) -> Result<Subscription<'_, K, M, T, F>, SubscriptionError<K>>

Returns a subscription to all events, or a SubscriptionError<K> if the subscription could not be created.

[req:subs.all]

source

pub fn is_capturing(&self) -> bool

Returns true if capturing is active.

[req:cap.ctrl.info]

source

pub fn start(&self)

Start capturing.

Note: Capturing is already started initially, so this function is only needed after manually stopping capturing.

[req:cap.ctrl.start]

source

pub fn stop(&self)

Stop capturing.

[req:cap.ctrl.stop]

Auto Trait Implementations§

§

impl<K, M, T, F> RefUnwindSafe for EvidentPublisher<K, M, T, F>where F: RefUnwindSafe,

§

impl<K, M, T, F> Send for EvidentPublisher<K, M, T, F>where F: Send,

§

impl<K, M, T, F> Sync for EvidentPublisher<K, M, T, F>where F: Sync,

§

impl<K, M, T, F> Unpin for EvidentPublisher<K, M, T, F>where F: Unpin,

§

impl<K, M, T, F> UnwindSafe for EvidentPublisher<K, M, T, F>where F: UnwindSafe,

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.

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V