SubscribingHandler

Struct SubscribingHandler 

Source
pub struct SubscribingHandler<H, M>
where H: Handler<M>,
{ /* private fields */ }
Expand description

Provides the Subscriber and Handler traits for a wrapped Handler delegate.

Implementations§

Source§

impl<H, M> SubscribingHandler<H, M>
where H: Handler<M>,

Source

pub fn new(handler: H) -> SubscribingHandler<H, M>

Creates a SubscribingHandler from a given Handler.

Source§

impl<H, M> SubscribingHandler<H, M>
where H: Handler<M> + 'static, M: 'static,

Source

pub fn into_heap(self) -> Subscriber<M>

Trait Implementations§

Source§

impl<H, M> From<H> for SubscribingHandler<H, M>
where H: Handler<M>,

Source§

fn from(handler: H) -> Self

Converts to this type from the input type.
Source§

impl<H, M> Handler<M> for SubscribingHandler<H, M>
where H: Handler<M>,

Source§

fn handle(&self, message: &M)

Receives a borrowed value.
Source§

impl<H, M> Hash for SubscribingHandler<H, M>
where H: Handler<M> + Hash,

Source§

fn hash<S: Hasher>(&self, state: &mut S)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<H, M> PartialEq for SubscribingHandler<H, M>
where H: PartialEq + Handler<M>,

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<H, M> Subscriber<M> for SubscribingHandler<H, M>
where H: Handler<M>,

Source§

fn receive(&self, message: &M)

Receives a borrowed message for the Subscriber to process.
Source§

impl<H, M> Eq for SubscribingHandler<H, M>
where H: Eq + Handler<M>,

Auto Trait Implementations§

§

impl<H, M> Freeze for SubscribingHandler<H, M>
where H: Freeze,

§

impl<H, M> RefUnwindSafe for SubscribingHandler<H, M>

§

impl<H, M> Send for SubscribingHandler<H, M>
where H: Send, M: Send,

§

impl<H, M> Sync for SubscribingHandler<H, M>
where H: Sync, M: Sync,

§

impl<H, M> Unpin for SubscribingHandler<H, M>
where H: Unpin, M: Unpin,

§

impl<H, M> UnwindSafe for SubscribingHandler<H, M>
where H: UnwindSafe, M: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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<H, M> IntoSubscriber<H, M> for H
where H: Handler<M>,

Source§

fn into_subscriber(self) -> SubscribingHandler<H, M>

Wraps the Handler in a SubscribingHandler, for use as a Subscriber.
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.