[][src]Struct revent::example::ExampleHub

pub struct ExampleHub {
    pub event1: Topic<dyn EventHandler>,
    pub event2: Topic<dyn EventHandler>,
    // some fields omitted
}

Hub of events.

Contains various topics which can be emitted into or subscribed to.

Fields

event1: Topic<dyn EventHandler>

Channel for the given type of event handler.

event2: Topic<dyn EventHandler>

Channel for the given type of event handler.

Methods

impl ExampleHub[src]

pub fn new() -> Self[src]

Create a new hub.

pub fn subscribe<T: Subscriber + Selfscriber<Self>>(&mut self, input: T::Input) where
    T::Hub: for<'a> TryFrom<&'a Self, Error = ()>, 
[src]

Insert a subscriber into the hub.

Requires the trait Subscriber and Selfscriber. Selfscriber is implemented by creating a derivative hub. See the examples/ directory for usage.

pub fn graph(&self) -> String[src]

Generate a graphviz (dot) style graph.

Trait Implementations

impl Default for ExampleHub[src]

impl Drop for ExampleHub[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.