Topic

Trait Topic 

Source
pub trait Topic:
    Debug
    + Clone
    + Hash
    + Eq {
    type Item;

    // Required method
    fn topic(item: &Self::Item) -> Self;

    // Provided method
    fn fallback(self) -> Self { ... }
}
Expand description

The topic that will be used to route items to a specific subscriber.

Required Associated Types§

Source

type Item

The type of the items in the Subable stream.

Required Methods§

Source

fn topic(item: &Self::Item) -> Self

Identify the topic from the item type.

Provided Methods§

Source

fn fallback(self) -> Self

Fallback for when the item is unhandled, you might want to change it’s Topic based on this knowledge.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§