pub struct EventClient<C: PackageConsumer> { /* private fields */ }Expand description
Reusable sans-I/O event subscriber.
Implementations§
Source§impl<C: PackageConsumer> EventClient<C>
impl<C: PackageConsumer> EventClient<C>
Sourcepub fn new(config: Config) -> Result<Self, StartError>
pub fn new(config: Config) -> Result<Self, StartError>
Construct a bounded client.
Sourcepub fn contains(&self, id: SubscriptionId) -> bool
pub fn contains(&self, id: SubscriptionId) -> bool
Whether a subscription is still owned.
Sourcepub fn connection_selected(
&mut self,
id: SubscriptionId,
generation: Option<u64>,
)
pub fn connection_selected( &mut self, id: SubscriptionId, generation: Option<u64>, )
Record the exact stream generation selected by the transport for the latest SUBSCRIBE.
Sourcepub fn start(
&mut self,
start: Start<C>,
) -> Result<Started<C::Value>, StartError>
pub fn start( &mut self, start: Start<C>, ) -> Result<Started<C::Value>, StartError>
Begin one subscription and return its ordered initial outputs.
Sourcepub fn response(
&mut self,
id: SubscriptionId,
response: Option<&Response>,
cnonce: &str,
) -> Vec<Output<C::Value>>
pub fn response( &mut self, id: SubscriptionId, response: Option<&Response>, cnonce: &str, ) -> Vec<Output<C::Value>>
Consume one final SUBSCRIBE response. cnonce is fresh driver-supplied entropy for a
possible digest retry.
Sourcepub fn notify(
&mut self,
transaction: u64,
request: &Request,
source: Peer,
) -> Vec<Output<C::Value>>
pub fn notify( &mut self, transaction: u64, request: &Request, source: Peer, ) -> Vec<Output<C::Value>>
Consume and answer one NOTIFY. The driver token is returned unchanged in
Output::RespondNotify.
Sourcepub fn consumer_drained(&mut self, id: SubscriptionId, count: usize)
pub fn consumer_drained(&mut self, id: SubscriptionId, count: usize)
Report application deliveries removed from the bounded queue.
Sourcepub fn timer_fired(
&mut self,
id: SubscriptionId,
timer: Timer,
generation: u64,
) -> Vec<Output<C::Value>>
pub fn timer_fired( &mut self, id: SubscriptionId, timer: Timer, generation: u64, ) -> Vec<Output<C::Value>>
Fire one exact timer generation.
Sourcepub fn unsubscribe(&mut self, id: SubscriptionId) -> Vec<Output<C::Value>>
pub fn unsubscribe(&mut self, id: SubscriptionId) -> Vec<Output<C::Value>>
Request an in-dialog Expires 0 operation.
Sourcepub fn shutdown(&mut self) -> Vec<Output<C::Value>>
pub fn shutdown(&mut self) -> Vec<Output<C::Value>>
Close admission and begin one bounded unsubscribe per live usage.
Sourcepub fn shutdown_deadline(&mut self) -> Vec<Output<C::Value>>
pub fn shutdown_deadline(&mut self) -> Vec<Output<C::Value>>
Force the global shutdown deadline and release all state.
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for EventClient<C>
impl<C> !RefUnwindSafe for EventClient<C>
impl<C> Send for EventClient<C>
impl<C> Sync for EventClient<C>where
C: Sync,
impl<C> Unpin for EventClient<C>where
C: Unpin,
impl<C> UnsafeUnpin for EventClient<C>
impl<C> !UnwindSafe for EventClient<C>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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