pub struct EventProducer<T, D>{ /* private fields */ }Expand description
The producer of the Serf events.
Implementations§
Source§impl<T, D> EventProducer<T, D>
impl<T, D> EventProducer<T, D>
Sourcepub fn bounded(size: usize) -> (Self, EventSubscriber<T, D>)
pub fn bounded(size: usize) -> (Self, EventSubscriber<T, D>)
Creates a bounded producer and subscriber.
The created subscriber has space to hold at most cap events at a time. Users must actively consume the events from the subscriber to prevent the producer from blocking.
Sourcepub fn unbounded() -> (Self, EventSubscriber<T, D>)
pub fn unbounded() -> (Self, EventSubscriber<T, D>)
Creates an unbounded producer and subscriber.
The created subscriber has no limit on the number of events it can hold.
Trait Implementations§
Auto Trait Implementations§
impl<T, D> Freeze for EventProducer<T, D>
impl<T, D> RefUnwindSafe for EventProducer<T, D>
impl<T, D> Send for EventProducer<T, D>
impl<T, D> Sync for EventProducer<T, D>
impl<T, D> Unpin for EventProducer<T, D>
impl<T, D> UnsafeUnpin for EventProducer<T, D>
impl<T, D> UnwindSafe for EventProducer<T, D>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more