Trait evelyn::Subscription[][src]

pub trait Subscription where
    Self: PartialEq
{ type Event: Message; fn subscribed_to(&self, message: &Self::Event) -> bool;
fn discriminant_set(&self) -> &[<Self::Event as Message>::Discriminant];
fn send_event(
        &self,
        message: Self::Event
    ) -> Result<(), SendError<Self::Event>>; }

A trait describin a bus subscription

Associated Types

Loading content...

Required methods

fn subscribed_to(&self, message: &Self::Event) -> bool[src]

Test whether this subscriiption is subscribed to a message

fn discriminant_set(&self) -> &[<Self::Event as Message>::Discriminant][src]

Returns a slice of discriminants corresponding to messages this subsccription is subscribed to

fn send_event(&self, message: Self::Event) -> Result<(), SendError<Self::Event>>[src]

Delivers a message to this subscription’s reciever

Loading content...

Implementors

impl<M> Subscription for Subscriber<M> where
    M: Message + Debug
[src]

type Event = M

Loading content...